#include <Logging.hh>
Public Types | |
typedef map< const string, Log * > | LogMap |
Typedef for a collection of named logs. | |
typedef map< const string, Level > | LevelMap |
Typedef for a collection of named log levels. | |
enum | Level { TRACE = 0, DEBUG = 10, INFO = 20, WARN = 30, ERROR = 40 } |
Log priority levels. More... | |
Public Member Functions | |
Level | getLevel () const |
Get the priority level of this logger. | |
Log & | setLevel (const Level &level) |
Set the priority level of this logger. | |
string | getName () const |
Get the name of this logger. | |
Log & | setName (const string &name) |
Set the name of this logger. | |
bool | isActive (const Level &level) const |
Will this log level produce output on this logger at the moment? | |
Explicit log methods | |
void | trace (const string &message) |
void | debug (const string &message) |
void | info (const string &message) |
void | warn (const string &message) |
void | error (const string &message) |
Static Public Member Functions | |
void | setDefaultLevels (const LevelMap &logLevels) |
Set the default log levels. | |
void | setShowTimestamp (const bool showTime=true) |
void | setShowLevel (const bool showLevel=true) |
void | setShowLoggerName (const bool showName=true) |
Log & | getLog (const string &name) |
Copy assignment operator. | |
Log & | getLog (const string &name, const Level &level) |
Get a logger with the given name and level. | |
Level | getLevelFromName (const string &level) |
Get a log level enum from a string. | |
string | getLevelName (const Level &level) |
Get the string representation of a log level. | |
Public Attributes | |
ostream *const | _nostream |
Protected Member Functions | |
void | log (const Level &level, const string &message) |
Write a message at a particular level. | |
string | formatMessage (const Level &level, const string &message) |
Turn a message string into the current log format. | |
Hidden constructors etc. | |
Log (const string &name) | |
Constructor 1. | |
Log (const string &name, const Level &level) | |
Constructor 2. | |
Friends | |
ostream & | operator<< (Log &log, const Log::Level &level) |
The streaming operator can use Log's internals. |
|
Typedef for a collection of named log levels.
Definition at line 22 of file Logging.hh. Referenced by Rivet::Commandline::useLoggingArgs(). |
|
Typedef for a collection of named logs.
Definition at line 19 of file Logging.hh. |
|
Log priority levels.
Definition at line 14 of file Logging.hh. Referenced by Log::getLog(). |
|
Constructor 1.
Definition at line 16 of file Logging.cc. Referenced by Log::getLog(). |
|
Constructor 2.
Definition at line 20 of file Logging.cc. |
|
Definition at line 121 of file Logging.hh. Referenced by main(). |
|
Definition at line 127 of file Logging.hh. |
|
Turn a message string into the current log format.
Definition at line 91 of file Logging.cc. References Log::getName(). Referenced by Log::log(), and Rivet::operator<<(). |
|
Get the priority level of this logger.
Definition at line 85 of file Logging.hh. |
|
Get a log level enum from a string.
Definition at line 81 of file Logging.cc. |
|
Get the string representation of a log level.
Definition at line 64 of file Logging.cc. References Log::DEBUG, Log::ERROR, Log::INFO, Log::TRACE, and Log::WARN. |
|
Get a logger with the given name and level.
Definition at line 55 of file Logging.cc. References Log::Log(). |
|
Copy assignment operator. Get a logger with the given name. The level will be taken from the "requestedLevels" static map or will be INFO by default. Definition at line 24 of file Logging.cc. References Log::Level, and Log::Log(). Referenced by Projection::getLog(), and main(). |
|
Get the name of this logger.
Definition at line 102 of file Logging.hh. Referenced by Log::formatMessage(). |
|
Definition at line 123 of file Logging.hh. Referenced by main(). |
|
Will this log level produce output on this logger at the moment?
Definition at line 113 of file Logging.hh. Referenced by Log::log(), Rivet::operator<<(), VetoedFinalState::project(), and TrackJet::project(). |
|
Write a message at a particular level.
Definition at line 117 of file Logging.cc. References Log::formatMessage(), and Log::isActive(). |
|
Set the default log levels.
Definition at line 42 of file Logging.hh. Referenced by main(). |
|
Set the priority level of this logger.
Definition at line 90 of file Logging.hh. |
|
Set the name of this logger.
Definition at line 107 of file Logging.hh. |
|
Definition at line 50 of file Logging.hh. |
|
Definition at line 54 of file Logging.hh. |
|
Definition at line 46 of file Logging.hh. |
|
Definition at line 119 of file Logging.hh. |
|
Definition at line 125 of file Logging.hh. Referenced by main(). |
|
The streaming operator can use Log's internals.
Definition at line 94 of file testNewLogging.cc. |
|
A null output stream, used for piping discarded output to nowhere.
Definition at line 148 of file Logging.hh. Referenced by Rivet::operator<<(). |