WARPXM v1.10.0
Loading...
Searching...
No Matches
WxLogger Class Reference

#include <wxlogger.h>

Inheritance diagram for WxLogger:
WxLoggerBase< WxLogger >

Public Types

enum class  eLevels {
  not_set = 0 , debug = 10 , info = 20 , warning = 30 ,
  error = 40 , critical = 50 , disabled = 1000
}
 
typedef std::map< eLevels, std::string, std::less< eLevels > > LevelMap_t
 
typedef std::map< std::string, eLevels, std::less< std::string > > StringMap_t
 
- Public Types inherited from WxLoggerBase< WxLogger >
typedef std::map< std::string, WxLogger *, std::less< std::string > > LoggerMap_t
 
typedef std::pair< std::string, WxLogger * > LoggerPair_t
 

Public Member Functions

 WxLogger (const std::string &name)
 Creates a new logger with given name.
 
virtual ~WxLogger ()
 Delete logger and all log record handlers.
 
void debug (const std::string &msg) const
 Log a debug message.
 
void info (const std::string &msg) const
 Log a info message.
 
void warning (const std::string &msg) const
 Log a warning message.
 
void error (const std::string &msg) const
 Log a error message.
 
void critical (const std::string &msg) const
 Log a critical message.
 
void log (const std::string &msg, eLevels withLevel) const
 Generic message logger.
 
void setLevel (enum eLevels level)
 Set verbosity level.
 
void setLevel (const std::string &level)
 Set verbosity level passing a string.
 
eLevels getLevel () const
 Get verbosity level.
 
std::string getLevelStr ()
 Get verbosity level as a string.
 
void addHandler (WxLogRecordHandler *handler)
 Add a new handler to the logger.
 
void disable ()
 Disables all logging to this logger.
 
void enable ()
 Re-enables logging to this logger.
 
WxLogStream getDebugStream ()
 Return stream to log debug messages.
 
WxLogStream getInfoStream ()
 Return stream to log info messages.
 
WxLogStream getWarningStream ()
 Return stream to log warning messages.
 
WxLogStream getErrorStream ()
 Return stream to log error messages.
 
WxLogStream getCriticalStream ()
 Return stream to log critical messages.
 

Friends

class WxLoggerBase< WxLogger >
 

Additional Inherited Members

- Static Public Member Functions inherited from WxLoggerBase< WxLogger >
static WxLoggerget (const std::string &nm)
 Returns a logger with a given name.
 
static WxLoggergetSafe (const std::string &nm)
 Returns a logger with a given name.
 
static void cleanUp ()
 Delete all loggers registered in the system.
 

Member Typedef Documentation

◆ LevelMap_t

typedef std::map<eLevels, std::string, std::less<eLevels> > WxLogger::LevelMap_t

◆ StringMap_t

typedef std::map<std::string, eLevels, std::less<std::string> > WxLogger::StringMap_t

Member Enumeration Documentation

◆ eLevels

enum class WxLogger::eLevels
strong
Enumerator
not_set 
debug 
info 
warning 
error 
critical 
disabled 

Constructor & Destructor Documentation

◆ WxLogger()

WxLogger::WxLogger ( const std::string &  name)

Creates a new logger with given name.

The verbosity is set NOTSET. However, by default no handlers are installed so no messages will be logged.

◆ ~WxLogger()

virtual WxLogger::~WxLogger ( )
virtual

Delete logger and all log record handlers.

Member Function Documentation

◆ addHandler()

void WxLogger::addHandler ( WxLogRecordHandler handler)

Add a new handler to the logger.

Parameters
handlerInstance of class WxLogRecordHandler. Note that the handler is not owned by the logger and hence is never deleted.

◆ critical()

void WxLogger::critical ( const std::string &  msg) const

Log a critical message.

◆ debug()

void WxLogger::debug ( const std::string &  msg) const

Log a debug message.

◆ disable()

void WxLogger::disable ( )

Disables all logging to this logger.

Logging at the original level can be resumed by calling the 'enable' method.

◆ enable()

void WxLogger::enable ( )

Re-enables logging to this logger.

The verbosity level is set to the one prior to the disable call.

◆ error()

void WxLogger::error ( const std::string &  msg) const

Log a error message.

◆ getCriticalStream()

WxLogStream WxLogger::getCriticalStream ( )

Return stream to log critical messages.

◆ getDebugStream()

WxLogStream WxLogger::getDebugStream ( )

Return stream to log debug messages.

◆ getErrorStream()

WxLogStream WxLogger::getErrorStream ( )

Return stream to log error messages.

◆ getInfoStream()

WxLogStream WxLogger::getInfoStream ( )

Return stream to log info messages.

◆ getLevel()

eLevels WxLogger::getLevel ( ) const

Get verbosity level.

◆ getLevelStr()

std::string WxLogger::getLevelStr ( )

Get verbosity level as a string.

◆ getWarningStream()

WxLogStream WxLogger::getWarningStream ( )

Return stream to log warning messages.

◆ info()

void WxLogger::info ( const std::string &  msg) const

Log a info message.

◆ log()

void WxLogger::log ( const std::string &  msg,
eLevels  withLevel 
) const

Generic message logger.

◆ setLevel() [1/2]

void WxLogger::setLevel ( const std::string &  level)

Set verbosity level passing a string.

◆ setLevel() [2/2]

void WxLogger::setLevel ( enum eLevels  level)

Set verbosity level.

◆ warning()

void WxLogger::warning ( const std::string &  msg) const

Log a warning message.

Friends And Related Function Documentation

◆ WxLoggerBase< WxLogger >

friend class WxLoggerBase< WxLogger >
friend

The documentation for this class was generated from the following file: