33 #include "WLogEntry.h"
54 WLogStream( std::ostream& output, LogLevel logLevel = LL_DEBUG, std::string format =
"*%l [%s] %m \n",
bool colored =
true );
Represents a simple log message with some attributes.
Class implementing a capsule for an output stream and the needed level and format information.
void setFormat(std::string format)
Sets the format string.
void setLogLevel(LogLevel logLevel)
Sets the new log level.
bool m_color
True if colors should be used.
std::ostream & m_output
The output stream.
LogLevel m_logLevel
The logging level.
std::shared_ptr< WLogStream > SharedPtr
shared pointer type
bool isColored() const
Getter determining whether to use colors or not.
WLogStream * Ptr
pointer type
void printEntry(const WLogEntry &entry)
Prints the specified entry to the output stream in the right format if the log level matches.
void setColored(bool colors)
Set whether to use colors or not.
LogLevel getLogLevel() const
Gets the currently set log level.
const WLogStream & ConstRef
const reference
WLogStream(std::ostream &output, LogLevel logLevel=LL_DEBUG, std::string format="*%l [%s] %m \n", bool colored=true)
Constructor.
WLogStream & Ref
reference
std::string getFormat() const
Returns the currently set format string.
WLogStream(const WLogStream &rhs)
Disallow copy.
WLogStream & operator=(const WLogStream &rhs)
Disallow assignment.
std::string m_format
The format of the message.