Provides logging messages in the stream. More...
#include <cadex/Base_LoggerStreamAppender.hxx>
Public Types | |
typedef std::ostream | StreamType |
Defines a stream type. | |
![]() | |
typedef UTF16 | CharType |
Defines a character type of user-visible strings. | |
typedef const UTF16 * | CharPointerType |
Defines a type of the pointer to the character type. | |
Public Member Functions | |
Base_LoggerStreamAppender (StreamType &theStream) | |
Constructor. | |
bool | AppendEOL () const |
Returns true if the end-of-line symbol is to be added after each message. | |
bool & | AppendEOL () |
Returns true if the end-of-line symbol is to be added after each message. | |
bool | ImmediateFlush () const |
Returns true if each message must be flushed into the stream. | |
bool & | ImmediateFlush () |
Returns true if each message must be flushed into the stream. | |
virtual void | Append (CharPointerType theMessage) |
Outputs a message into the stream. | |
![]() | |
virtual | ~Base_LoggerAppender () |
Destructor. | |
Base_LoggerAppender & | operator= (const Base_LoggerAppender &theAppender) |
Assignment operator. | |
virtual void | Append (CharPointerType theMessage)=0 |
Appends a message. | |
const std::shared_ptr< internal::Base_LoggerAppenderImpl > & | Impl () const |
Returns internal implementation object. | |
Additional Inherited Members | |
![]() | |
Base_LoggerAppender () | |
Constructor. | |
Base_LoggerAppender (const std::shared_ptr< internal::Base_LoggerAppenderImpl > &theImpl) | |
Constructor. | |
Base_LoggerAppender (const Base_LoggerAppender &theAppender) | |
Constructor. | |
void | Construct (const std::shared_ptr< internal::Base_LoggerAppenderImpl > &theImpl) |
Delayed constructor. | |
Base_LoggerAppender * | This () |
Returns a pointer to this object. | |
Provides logging messages in the stream.
The stream must be opened before using the appender and must remain opened and valid throughout its life span. Internally the appender stores a reference to the stream and thus destroying the stream earlier will likely lead to a crash.
The stream appender can be used with standard streams as follows:
The stream appender provides two boolean flags: AppendEOL() - if true then each message will be appended with end-of-line symbol (which is OS-specific, e.g. 0x0A on Linux and 0x0D 0x0A on Windows). By default, true. ImmediateFlush() - if true then each message will be flushed into the stream during processing in Append(). By default, true.
typedef std::ostream cadex::Base_LoggerStreamAppender::StreamType |
Defines a stream type.
Uses UTF-8 encoding when writing.
|
virtual |
Outputs a message into the stream.
Implements cadex::Base_LoggerAppender.