30 #include "WTerminalColor.h"
51 LogLevel logLevelFromString(
const std::string& str );
67 WLogEntry( std::string logTime, std::string message, LogLevel level, std::string source =
"" );
80 std::string
getLogString( std::string format =
"[%t] *%l* %m \n",
bool colors =
true )
const;
Represents a simple log message with some attributes.
virtual ~WLogEntry()
Destroys a log message entry.
std::string m_source
Source (e.g.
WLogEntry(std::string logTime, std::string message, LogLevel level, std::string source="")
Creates a new log message.
std::string m_message
The actual message.
std::string getLogString(std::string format="[%t] *%l* %m \n", bool colors=true) const
LogLevel m_level
Log level.
LogLevel getLogLevel() const
WTerminalColor m_timeColor
Color used for time.
std::string getMessage() const
Returns the plain message of the entry.
WTerminalColor m_errorColor
Color used for error logs.
WTerminalColor m_sourceColor
Color used for source field.
WTerminalColor m_messageColor
Color used for the message.
std::string m_time
The time the log message was received.
std::string getSource() const
Returns the sender of the log.
std::string getTime() const
Returns the formatted time string.
WTerminalColor m_warningColor
Color used for warning logs.
WTerminalColor m_infoColor
Color used for info logs.
WTerminalColor m_debugColor
Color used for debug logs.
Helper class to provide a convenient way to colorize output on the console.