Logging system for controlled & formatted writing to stdout.
More...
#include <Logging.hh>
|
enum | Level {
TRACE = 0
, DEBUG = 10
, INFO = 20
, WARN = 30
,
WARNING = 30
, ERROR = 40
, CRITICAL = 50
, ALWAYS = 50
} |
| Log priority levels.
|
|
typedef std::map< std::string, Log > | LogMap |
| Typedef for a collection of named logs.
|
|
typedef std::map< std::string, int > | LevelMap |
| Typedef for a collection of named log levels.
|
|
typedef std::map< int, std::string > | ColorCodes |
| Typedef for a collection of shell color codes, accessed by log level.
|
|
|
int | getLevel () const |
| Get the priority level of this logger.
|
|
Log & | setLevel (int level) |
| Set the priority level of this logger.
|
|
std::string | getName () const |
| Get the name of this logger.
|
|
Log & | setName (const std::string &name) |
| Set the name of this logger.
|
|
bool | isActive (int level) const |
| Will this log level produce output on this logger at the moment?
|
|
|
void | trace (const std::string &message) |
|
void | debug (const std::string &message) |
|
void | info (const std::string &message) |
|
void | warn (const std::string &message) |
|
void | error (const std::string &message) |
|
void | critical (const std::string &message) |
|
|
static void | setLevel (const std::string &name, int level) |
| Set the log levels.
|
|
static void | setLevels (const LevelMap &logLevels) |
|
static Log & | getLog (const std::string &name) |
|
static Level | getLevelFromName (const std::string &level) |
| Get a log level enum from a string.
|
|
static std::string | getLevelName (int level) |
| Get the std::string representation of a log level.
|
|
|
static const int | END_COLOR = -10 |
| Special "level-like" code to end coloring.
|
|
|
void | log (int level, const std::string &message) |
| Write a message at a particular level.
|
|
std::string | formatMessage (int level, const std::string &message) |
| Turn a message string into the current log format.
|
|
|
| Log (const std::string &name) |
| Constructor 1.
|
|
| Log (const std::string &name, int level) |
| Constructor 2.
|
|
|
static std::string | getColorCode (int level) |
| Get the TTY code string for coloured messages.
|
|
|
std::ostream & | operator<< (Log &log, int level) |
| The streaming operator can use Log's internals.
|
|
Logging system for controlled & formatted writing to stdout.
◆ getLog()
static Log & Rivet::Log::getLog |
( |
const std::string & |
name | ) |
|
|
static |
The documentation for this class was generated from the following file:
- /Users/chrisg/software/rivet/include/Rivet/Tools/Logging.hh