Library of Assembled Shared Sources
|
Logs proxy streams to files. More...
#include <logger.h>
Public Member Functions | |
Logger (const std::string &iLogFile, LogMode iLogMode=lmClear) | |
Default constructor for the sake of static library. | |
~Logger () | |
Unsubscribe to all proxys. | |
void | subscribeTo (ProxyOStream *iProxy, TMask iFilter=ProxyOStream::acceptAll) |
Subscribe this logger to a proxy stream and set the filter on it. | |
void | unsubscribeTo (ProxyOStream *iProxy) |
Unsubscribe this logger to a proxy stream. | |
TMask | filter (ProxyOStream *iProxy) |
return the filter between proxy and logger | |
void | setFilter (ProxyOStream *iProxy, TMask iFilter) |
Set filter between proxy and logger. | |
Logs proxy streams to files.
Construct a logger and subscribe it to proxy streams so it can log them. All output to all proxy streams it is subscribed to will be saved to a file. Per proxy stream you can set a filter of what messages should be logged. The logger will unsubscribe itself on destruction.
lass::io::Logger::Logger | ( | const std::string & | iLogFilename, |
LogMode | iLogMode = lmClear ) |
Default constructor for the sake of static library.
We don't recommend of using it. Create a logger to a log file and specify if it must append to the file or clear it.
Definition at line 62 of file logger.cpp.
void lass::io::Logger::subscribeTo | ( | ProxyOStream * | iProxy, |
TMask | iFilter = ProxyOStream::acceptAll ) |
Subscribe this logger to a proxy stream and set the filter on it.
iProxy | if null pointer, then an exception is thrown. |
iFilter | filter between proxy and logger |
Definition at line 86 of file logger.cpp.
References lass::io::ProxyOStream::add().
void lass::io::Logger::unsubscribeTo | ( | ProxyOStream * | iProxy | ) |
Unsubscribe this logger to a proxy stream.
iProxy | if null pointer, then an exception is thrown. |
Definition at line 97 of file logger.cpp.
References lass::io::ProxyOStream::remove().
Logger::TMask lass::io::Logger::filter | ( | ProxyOStream * | iProxy | ) |
return the filter between proxy and logger
iProxy | logger must be subscribed to this proxy (and proxy should not be a NULL pointer), otherwise and exception is thrown. |
Definition at line 109 of file logger.cpp.
void lass::io::Logger::setFilter | ( | ProxyOStream * | iProxy, |
TMask | iFilter ) |
Set filter between proxy and logger.
iProxy | logger must be subscribed to this proxy (and proxy should not be a NULL pointer), otherwise and exception is thrown. |
iFilter | the filter between proxy and logger. |
Definition at line 121 of file logger.cpp.
References setFilter().
Referenced by setFilter().