28 typedef std::map<std::string, T*, std::less<std::string>>
LoggerMap_t;
38 static T*
get(
const std::string& nm)
45 typename LoggerMap_t::iterator i = _loggers->find(nm);
46 if (i != _loggers->end())
53 for (
int i = nm.size(); i >= 0; --i, ++len)
54 if ((nm[i] ==
'.') || (i == 0))
78 typename LoggerMap_t::iterator i = _loggers->find(nm);
79 if (i != _loggers->end())
83 wxe <<
"Logger " << nm <<
" not found";
92 typename LoggerMap_t::iterator itr;
95 for (itr = _loggers->begin(); itr != _loggers->end(); ++itr)
125 typedef std::map<eLevels, std::string, std::less<eLevels>>
LevelMap_t;
127 typedef std::map<std::string, eLevels, std::less<std::string>>
StringMap_t;
144 void debug(
const std::string& msg)
const;
149 void info(
const std::string& msg)
const;
159 void error(
const std::string& msg)
const;
242 std::vector<WxLogRecordHandler*> _handlers;
Class to handle log messages generated by WarpX logging system.
Definition: wxlogrecordhandler.h:25
Provides interface to streaming iostreams to logs.
Definition: wxlogstream.h:19
Establishes basic interface of loggers.
Definition: wxlogger.h:26
static T * getSafe(const std::string &nm)
Returns a logger with a given name.
Definition: wxlogger.h:72
std::pair< std::string, T * > LoggerPair_t
Definition: wxlogger.h:29
std::map< std::string, T *, std::less< std::string > > LoggerMap_t
Definition: wxlogger.h:28
static void cleanUp()
Delete all loggers registered in the system.
Definition: wxlogger.h:90
static T * get(const std::string &nm)
Returns a logger with a given name.
Definition: wxlogger.h:38
Definition: wxlogger.h:109
std::map< std::string, eLevels, std::less< std::string > > StringMap_t
Definition: wxlogger.h:127
WxLogger(const std::string &name)
Creates a new logger with given name.
void setLevel(const std::string &level)
Set verbosity level passing a string.
void addHandler(WxLogRecordHandler *handler)
Add a new handler to the logger.
WxLogStream getWarningStream()
Return stream to log warning messages.
eLevels getLevel() const
Get verbosity level.
void debug(const std::string &msg) const
Log a debug message.
WxLogStream getInfoStream()
Return stream to log info messages.
void enable()
Re-enables logging to this logger.
WxLogStream getCriticalStream()
Return stream to log critical messages.
std::map< eLevels, std::string, std::less< eLevels > > LevelMap_t
Definition: wxlogger.h:125
void warning(const std::string &msg) const
Log a warning message.
void critical(const std::string &msg) const
Log a critical message.
void error(const std::string &msg) const
Log a error message.
void info(const std::string &msg) const
Log a info message.
void log(const std::string &msg, eLevels withLevel) const
Generic message logger.
WxLogStream getErrorStream()
Return stream to log error messages.
void disable()
Disables all logging to this logger.
virtual ~WxLogger()
Delete logger and all log record handlers.
WxLogStream getDebugStream()
Return stream to log debug messages.
std::string getLevelStr()
Get verbosity level as a string.
eLevels
Definition: wxlogger.h:114
void setLevel(enum eLevels level)
Set verbosity level.
wxm::lib::Except is the class to use for creating and throwing exceptions.
Definition: wxexcept.h:31