olp-cpp-sdk
1.22.0
|
An appender that prints messages to a file. More...
#include <FileAppender.h>
Public Member Functions | |
FileAppender (const std::string &fileName, bool append=false, MessageFormatter formatter=MessageFormatter::createDefault()) | |
Creates a FileAppender instance. More... | |
bool | isValid () const |
Checks whether the stream is open and can be written to. More... | |
const std::string & | getFileName () const |
Gets the name of the file. More... | |
bool | getAppendFile () const |
Checks whether the file has the appender. More... | |
const MessageFormatter & | getMessageFormatter () const |
Gets the message formatter. More... | |
FileAppender & | setMessageFormatter (MessageFormatter formatter) |
Sets the message formatter. More... | |
IAppender & | append (const LogMessage &message) override |
Appends the message using char strings. More... | |
An appender that prints messages to a file.
|
explicit |
Creates a FileAppender
instance.
fileName | The name of the file to write to. |
append | True to append to an existing file; false otherwise. |
formatter | The message formatter. |
|
overridevirtual |
Appends the message using char strings.
message | The message to append. |
Implements olp::logging::IAppender.
|
inline |
Checks whether the file has the appender.
|
inline |
Gets the name of the file.
|
inline |
Gets the message formatter.
bool olp::logging::FileAppender::isValid | ( | ) | const |
Checks whether the stream is open and can be written to.
|
inline |
Sets the message formatter.
formatter | The message formatter. |