gramods
Public Member Functions | Static Public Attributes | List of all members
gramods::gmCore::LogFileMessageSink Class Reference

Message sink that writes to a specified log file. More...

#include <LogFileMessageSink.hh>

Inheritance diagram for gramods::gmCore::LogFileMessageSink:
Inheritance graph
[legend]
Collaboration diagram for gramods::gmCore::LogFileMessageSink:
Collaboration graph
[legend]

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

Detailed Description

Message sink that writes to a specified log file.

Member Function Documentation

◆ output()

void gramods::gmCore::LogFileMessageSink::output ( Message  msg)
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.

◆ setAppend()

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

◆ setLevel()

gramods::gmCore::OFactory::ParamSetterInsert gm_ofi_LogFileMessageSink_param_level &LogFileMessageSink::_gm_ofi(& gramods::gmCore::LogFileMessageSink::setLevel ( int  l)
inline

Set the level of messages to output.

This is an integer typically following the level of importance in ConsoleLevel, inclusive.

XML-attribute: level

◆ setLogFilePath()

void gramods::gmCore::LogFileMessageSink::setLogFilePath ( std::filesystem::path  path)

Sets the path to the log file to write to.

XML-attribute: logFilePath


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