18 #include <boost/scoped_ptr.hpp>
22 #include "mongo/client/export_macros.h"
23 #include "mongo/logger/labeled_level.h"
24 #include "mongo/logger/log_component.h"
25 #include "mongo/logger/log_severity.h"
26 #include "mongo/logger/message_log_domain.h"
38 static LogSeverity MONGO_CLIENT_FUNC severityCast(
int ll) {
55 const std::string& contextName,
66 const std::string& contextName,
74 const std::string& contextName,
97 _baseMessage = baseMessage;
101 std::ostream& stream() {
106 LogstreamBuilder& operator<<(
const char* x) {
110 LogstreamBuilder& operator<<(
const std::string& x) {
114 LogstreamBuilder& operator<<(
const StringData& x) {
118 LogstreamBuilder& operator<<(
char* x) {
122 LogstreamBuilder& operator<<(
char x) {
126 LogstreamBuilder& operator<<(
int x) {
130 LogstreamBuilder& operator<<(
long x) {
134 LogstreamBuilder& operator<<(
unsigned long x) {
138 LogstreamBuilder& operator<<(
unsigned x) {
142 LogstreamBuilder& operator<<(
unsigned short x) {
146 LogstreamBuilder& operator<<(
double x) {
150 LogstreamBuilder& operator<<(
void* x) {
154 LogstreamBuilder& operator<<(
const void* x) {
158 LogstreamBuilder& operator<<(
long long x) {
162 LogstreamBuilder& operator<<(
unsigned long long x) {
166 LogstreamBuilder& operator<<(
bool x) {
171 template <
typename T>
172 LogstreamBuilder& operator<<(
const T& x) {
173 stream() << x.toString();
177 LogstreamBuilder& operator<<(std::ostream&(MONGO_CLIENT_FUNC* manip)(std::ostream&)) {
181 LogstreamBuilder& operator<<(std::ios_base&(MONGO_CLIENT_FUNC* manip)(std::ios_base&)) {
190 void operator<<(Tee* tee);
193 LogstreamBuilder& operator=(
const LogstreamBuilder& other);
197 MessageLogDomain* _domain;
198 std::string _contextName;
199 LogSeverity _severity;
200 LogComponent _component;
201 std::string _baseMessage;
202 std::ostringstream* _os;
Log components.
Definition: log_component.h:32
Utility functions for parsing numbers from strings.
Definition: compare_numbers.h:20
LogstreamBuilder & setBaseMessage(const std::string &baseMessage)
Sets an optional prefix for the message.
Definition: logstream_builder.h:96
Stream-ish object used to build and append log messages.
Definition: logstream_builder.h:36
static LogSeverity cast(int)
Casts an integer to a severity.
Definition: log_severity-inl.h:40
Logging domain for events of type E.
Definition: log_domain.h:50
Representation of the severity / priority of a log message.
Definition: log_severity.h:33
Deprecated utility for associating a string and log level together.
Definition: labeled_level.h:28