42 Logger(
const std::string& sLogFile);
44 bool open(
const std::string& sLogFile);
48 void push(
const std::string& sMessage);
49 void push_line(
const std::string& sMessage);
80 bool open(
const std::string& sLogFile);
94 inline void debug(
const std::string& sMessage)
106 inline void info(
const std::string& sMessage)
118 inline void cmdline(
const std::string& sMessage)
130 inline void warning(
const std::string& sMessage)
142 inline void error(
const std::string& sMessage)
This class is a specialisation of the Logger to run detached, i.e. as a global instance usable form e...
bool is_buffering() const
Determine, whether this instance is currently buffering or directly writing to a file.
void push_info(const std::string &sInfo)
Push a message to the logger, which is not dependend on the logging level and will be shown without a...
bool open(const std::string &sLogFile)
Open the log file and push the buffered messages directly to this file.
void info(const std::string &sMessage)
Convenience member function.
void push_line(Logger::LogLevel lvl, const std::string &sMessage)
Push a message with the corresponding logging level to the logger. The message will be prefixed with ...
void warning(const std::string &sMessage)
Convenience member function.
void debug(const std::string &sMessage)
Convenience member function.
std::vector< std::string > m_buffer
~DetachedLogger()
DetachedLogger destructor. Appends a terminating message to the current logfile (if any).
DetachedLogger(Logger::LogLevel lvl=Logger::LVL_INFO)
DetachedLogger constructor. Sets the default logging level.
void error(const std::string &sMessage)
Convenience member function.
void setLoggingLevel(Logger::LogLevel lvl)
Change the logging level or completely disable the logger.
void write_system_information()
A helper function to write the current OS's information to the log file.
void cmdline(const std::string &sMessage)
Convenience member function.
This class represents a simple logging functionality, which might be extended in the future to handle...
bool ensure_open()
Ensures that the stream is open and tries to re-open it otherwise.
void push(const std::string &sMessage)
Push a message to the logger stream. Will automatically re-open a file, if the stream had been closed...
bool is_open() const
Check, whether the logger stream is currently open.
void push_line(const std::string &sMessage)
Push a line to the logger stream. The stream will automatically append the line termination character...
bool open(const std::string &sLogFile)
Open the target logging file for writing.
Logger()
Empty default constructor.
void close()
Close the logger stream.