31 #ifndef WINDOWMANAGER_LOGGER_H
32 #define WINDOWMANAGER_LOGGER_H
108 virtual void Log(
const std::string& message,
LogLevel level)
const;
LogLevel
Log levels L_INFO: Informational messages L_WARNING: Warning messages L_ERROR: Error messages.
Definition: Logger.hpp:48
@ L_ERROR
Definition: Logger.hpp:51
@ L_WARNING
Definition: Logger.hpp:50
@ L_INFO
Definition: Logger.hpp:49
Logger class This class is responsible for logging. It can be created with a file name or an ostream....
Definition: Logger.hpp:60
static std::string GetTime()
Get the current time.
Definition: Logger.cpp:79
LogLevel logLevel_
Definition: Logger.hpp:149
Logger & operator=(const Logger &)=delete
virtual void Log(const std::string &message, LogLevel level) const
Log a message This method logs a message to the log file or stream. The message is only logged if the...
Definition: Logger.cpp:73
static Logger * instance_
Definition: Logger.hpp:147
static void Create(const std::string &logFile, LogLevel logLevel)
Definition: Logger.cpp:31
bool streamIsFile_
Definition: Logger.hpp:146
static std::string GetLogLevel(LogLevel level)
Get the log level as a string.
Definition: Logger.cpp:86
std::ostream * logStream_
Definition: Logger.hpp:148
virtual ~Logger()
Destroy the Logger:: Logger object closes the log file if it was opened. The destructor is virtual to...
Definition: Logger.cpp:62
static void Destroy()
Destroy the Logger:: Logger object closes the log file if it was opened.
Definition: Logger.cpp:99
static Logger * GetInstance()
Get the Logger object.
Definition: Logger.cpp:41
Logger(const Logger &)=delete