From c91a2c3392fc95be3ed07ba98a4d98b4db754b58 Mon Sep 17 00:00:00 2001 From: Benety Goh Date: Wed, 16 Jul 2014 12:35:13 -0400 Subject: 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. --- src/mongo/logger/logstream_builder.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/mongo/logger/logstream_builder.h') 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,12 +57,24 @@ 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. */ @@ -142,6 +155,7 @@ namespace logger { MessageLogDomain* _domain; std::string _contextName; LogSeverity _severity; + LogComponent _component; std::string _baseMessage; std::ostringstream* _os; Tee* _tee; -- cgit v1.2.1