diff options
author | Benety Goh <benety@mongodb.com> | 2014-07-16 12:35:13 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2014-07-29 17:42:21 -0400 |
commit | c91a2c3392fc95be3ed07ba98a4d98b4db754b58 (patch) | |
tree | 255115ae0f8391766ca75441b30225f6a4194d34 /src/mongo/logger/logstream_builder.h | |
parent | a0dcb4026b3f1171b4124e2666cf71460d023bb1 (diff) | |
download | mongo-c91a2c3392fc95be3ed07ba98a4d98b4db754b58.tar.gz |
SERVER-4217 updated detailed log format to include log severity and component name.
Log severity is logged with a single capital letter.
F - Severe
E - Error
W - Warning
I - Info and Debug Level 0
D - All debug levels > 0
Component name is logged in upper-case padded with trailing spaces to fit within 8 characters.
Diffstat (limited to 'src/mongo/logger/logstream_builder.h')
-rw-r--r-- | src/mongo/logger/logstream_builder.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/mongo/logger/logstream_builder.h b/src/mongo/logger/logstream_builder.h index f03af002339..33360ad9a5b 100644 --- a/src/mongo/logger/logstream_builder.h +++ b/src/mongo/logger/logstream_builder.h @@ -34,6 +34,7 @@ #include "mongo/client/export_macros.h" #include "mongo/logger/labeled_level.h" +#include "mongo/logger/log_component.h" #include "mongo/logger/log_severity.h" #include "mongo/logger/message_log_domain.h" #include "mongo/util/exit_code.h" @@ -56,13 +57,25 @@ namespace logger { * Construct a LogstreamBuilder that writes to "domain" on destruction. * * "contextName" is a short name of the thread or other context. - * "severity" is the logging priority/severity of the message. + * "severity" is the logging severity of the message. */ LogstreamBuilder(MessageLogDomain* domain, const std::string& contextName, LogSeverity severity); /** + * Construct a LogstreamBuilder that writes to "domain" on destruction. + * + * "contextName" is a short name of the thread or other context. + * "severity" is the logging severity of the message. + * "component" is the primary log component of the message. + */ + LogstreamBuilder(MessageLogDomain* domain, + const std::string& contextName, + LogSeverity severity, + LogComponent component); + + /** * Deprecated. */ LogstreamBuilder(MessageLogDomain* domain, @@ -142,6 +155,7 @@ namespace logger { MessageLogDomain* _domain; std::string _contextName; LogSeverity _severity; + LogComponent _component; std::string _baseMessage; std::ostringstream* _os; Tee* _tee; |