# SimpleTextLogPrinter Class Reference

This GenericLogPrinter implementation formats the log messages into a simple text format, suitable for displaying on a terminal output. More...

`#include <SimpleTextLogPrinter.h>`

Inheritance diagram for SimpleTextLogPrinter:

List of all members.

## 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

## Detailed Description

This GenericLogPrinter implementation formats the log messages into a simple text format, suitable for displaying on a terminal output.

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.

## Constructor & Destructor Documentation

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.

## Member Function Documentation

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().

The documentation for this class was generated from the following file:

- SimpleTextLogPrinter.h