helics
3.5.3
|
#include <logger.h>
Public Member Functions | |
Logger () | |
Logger (std::shared_ptr< LoggingCore > core) | |
~Logger () | |
void | openFile (const std::string &file) |
void | closeFile () |
void | startLogging (int cLevel, int fLevel) |
void | startLogging () |
void | haltLogging () |
void | log (int level, std::string logMessage) |
void | log (std::string logMessage) |
void | flush () |
bool | isRunning () const |
void | changeLevels (int cLevel, int fLevel) |
class implementing a thread safe Logger
the Logger uses a queuing mechanism and condition variable to store messages to a queue and print/display them in a single thread allowing for asynchronous logging
helics::Logger::Logger | ( | ) |
default constructor
|
explicit |
construct and link to the specified logging Core
helics::Logger::~Logger | ( | ) |
destructor
void helics::Logger::changeLevels | ( | int | cLevel, |
int | fLevel | ||
) |
alter the printing levels
cLevel | the level to print to the console |
fLevel | the level to print to the file if it is open |
void helics::Logger::closeFile | ( | ) |
close the current file for logging
void helics::Logger::flush | ( | ) |
flush the log queue
void helics::Logger::haltLogging | ( | ) |
stop logging for a time, messages received while halted are ignored
bool helics::Logger::isRunning | ( | ) | const |
check if the Logger is running
void helics::Logger::log | ( | int | level, |
std::string | logMessage | ||
) |
log a message at a particular level
level | the level of the message |
logMessage | the actual message to log |
|
inline |
message to log without regard for levels*
logMessage | the message to log |
References helics::always_log, and log().
Referenced by log().
void helics::Logger::openFile | ( | const std::string & | file | ) |
open a file to write the log messages
file | the name of the file to write messages to |
|
inline |
overload of
References startLogging().
Referenced by startLogging().
void helics::Logger::startLogging | ( | int | cLevel, |
int | fLevel | ||
) |
function to start the logging thread
cLevel | the console print level |
fLevel | the file print level messages coming in below these levels will be printed |