|
gramods
|
Message sink that writes to a specified log file. More...
#include <LogFileMessageSink.hh>


Public Member Functions | |
| void | setLogFilePath (std::filesystem::path path) |
| Sets the path to the log file to write to. More... | |
| void | setAppend (bool on) |
| Set to true if the messages should be appended to the end of the file, if it already exists. More... | |
| void | setLevel (int l) |
| Set the level of messages to output. More... | |
| void | output (Message msg) |
| Outputs the provided message to the implementation specific channel. More... | |
Public Member Functions inherited from gramods::gmCore::MessageSink | |
| virtual void | initialize () override |
| Called to initialize the MessageSink. More... | |
| void | setShowTime (bool on) |
| Activate or deactivate the output of the time of each message. More... | |
Public Member Functions inherited from gramods::gmCore::Object | |
| Object () | |
| Initializes internal data. More... | |
| virtual | ~Object () |
| Cleaning up internal data. More... | |
| virtual void | accept (Visitor *visitor) |
| Calls the visitors apply method with this as argument. More... | |
| virtual void | traverse (Visitor *visitor) |
| Calls the child Object's accept method, if such exist. More... | |
| virtual std::string | getDefaultKey () |
| Returns the default key for the Object when automatically instantiated in a Configuration, i.e. More... | |
| bool | isInitialized () |
| Returns true if the Object is initialized. More... | |
Static Public Attributes | |
| static gramods::gmCore::OFactory::OFactoryInformation | _gm_ofi |
Static Public Attributes inherited from gramods::gmCore::MessageSink | |
| static gramods::gmCore::OFactory::OFactoryInformation | _gm_ofi |
Additional Inherited Members | |
Protected Member Functions inherited from gramods::gmCore::MessageSink | |
| void | outputMetadata (std::ostream &out, Message msg) |
| Write metadata from the specified message to the specified stream. More... | |
Message sink that writes to a specified log file.
|
virtual |
Outputs the provided message to the implementation specific channel.
This method may be called concurrently from multiple thread and must therefore be thread safe.
Implements gramods::gmCore::MessageSink.
| void gramods::gmCore::LogFileMessageSink::setAppend | ( | bool | on | ) |
Set to true if the messages should be appended to the end of the file, if it already exists.
With false (default) the file will be overwritten.
XML-attribute: append
|
inline |
Set the level of messages to output.
This is an integer typically following the level of importance in ConsoleLevel, inclusive.
XML-attribute: level
| void gramods::gmCore::LogFileMessageSink::setLogFilePath | ( | std::filesystem::path | path | ) |
Sets the path to the log file to write to.
XML-attribute: logFilePath