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