30 #include "WLoggerWrapper.h"
31 #include "core/common/WAssert.h"
32 #include "core/common/WLogStream.h"
33 #include "core/common/WLogger.h"
41 WAssert( logger,
"Null pointer" );
58 std::shared_ptr< std::ofstream > fileStream(
new std::ofstream( filename.c_str() ) );
Class implementing a capsule for an output stream and the needed level and format information.
std::shared_ptr< WLogStream > SharedPtr
shared pointer type
void warning(std::string const &location, std::string const &message)
Output a warning to the logs.
void debug(std::string const &location, std::string const &message)
Output a debug message.
void removeFileStreamNumber(size_t i)
Helper function that removes the file stream with the given index.
void removeAllFileStreams()
Remove all files to which the logger writes (and which were added by this wrapper).
std::vector< FileStreamEntry > m_fileStreamList
List of file streams.
void error(std::string const &location, std::string const &message)
Output an error to the logs.
WLoggerWrapper()
Constructor.
bool addFileStream(std::string filename)
Add a file to which the logger output will be written.
~WLoggerWrapper()
Destructor.
bool removeFileStream(std::string filename)
Remove a file to which the logger writes.
void info(std::string const &location, std::string const &message)
Output information to the logs.
WLogger * m_logger
A pointer to the logger.
This class defines the interface for adding logs and managing several output streams for them.
void addLogMessage(std::string message, std::string source="", LogLevel level=LL_DEBUG)
Appends a log message to the logging queue.
void removeStream(WLogStream::SharedPtr s)
Remove the given stream.
void addStream(WLogStream::SharedPtr s)
Adds a new stream to the logger.
A helper class for storing information about file streams that we added to the logger.
std::string m_filename
The name of the log file.
WLogStream::SharedPtr m_WLogStream
The logstream instance.
std::shared_ptr< std::ofstream > m_fileStream
The actual stream.