#include <SimpleTextLogPrinter.h>
Public Member Functions | |
SimpleTextLogPrinter () | |
Default constructor. Initializes the Stream, Formatter and FirstLevelContentsPrinter attributes. | |
SimpleTextLogPrinter (const RegistryKey &key) | |
Constructor. Initializes the Stream, Formatter and FirstLevelContentsPrinter attributes. | |
Private Member Functions | |
std::tstring | DoFormatMessage (const LogInfo &logInfo, const CompositeLoggable &message) |
Private Attributes | |
boost::tformat | m_formatter |
std::tostringstream | m_stream |
FirstLevelContentsPrinter | m_firstLevelContentsPrinter |
Friends | |
class | Nvidia::Logging::Test::LoggerTest |
class | Nvidia::Logging::Test::LoggerConstructorTest |
Example output of SimpleTextLogPrinter:
0.901 | INFO: 123 @ foo::bar() : This is a simple log message. 430.433 | DEBUG: 99 @ abcDef::Ghi() : This is a 003.141 formatted log message. 232114.021 | CRITICAL: 5432 @ Display::attach() : Display1 attached to Gpu2. Display1=(Type=LCD, Serial=00001, IsLidClosed=false), Gpu2=(...)
Definition at line 79 of file SimpleTextLogPrinter.h.
SimpleTextLogPrinter | ( | const RegistryKey & | key | ) | [inline] |
Constructor. Initializes the Stream, Formatter and FirstLevelContentsPrinter attributes.
As there is no configuration needed for this GenericLogPrinter, the key parameter is ignored.
Definition at line 152 of file SimpleTextLogPrinter.h.
std::tstring DoFormatMessage | ( | const LogInfo & | logInfo, | |
const CompositeLoggable & | message | |||
) | [inline, private, virtual] |
This DoFormatMessage implementation formats the logInfo parameter using boost::format and appends the result of formatting the message on FirstLevelContentsPrinter to the result. That result is then returned.
Implements GenericLogPrinter< std::tstring >.
Definition at line 157 of file SimpleTextLogPrinter.h.
References LogInfo::GetFunctionName(), LogInfo::GetLevel(), LogInfo::GetLineNumber(), LogInfo::GetRelativeTimestamp(), LogInfo::GetScopeLoggerName(), Loggable::GetStringValue(), and CompositeLoggable::LogContentsOn().