The namespace 'log' contains routines for interacting with the message logger. More...
Classes | |
struct | LoggerManipulator |
Typedefs | |
typedef Level | Priority |
typedef Level | Severity |
typedef Level | Verbosity |
Enumerations | |
enum | Level { LEVEL_QUIET = 60 , LEVEL_CRITICAL = 50 , LEVEL_ERROR = 40 , LEVEL_WARNING = 30 , LEVEL_INFO = 20 , LEVEL_DEBUG = 10 , LEVEL_NOTSET = 0 , QUIET = LEVEL_QUIET , NORMAL = LEVEL_INFO , DEBUG = LEVEL_DEBUG } |
enum | Mode { MODE_UNDEFINED = -1 , MODE_SEPARATE = 0 , MODE_COMBINE , COMBINED = MODE_COMBINE , SEPARATE = MODE_SEPARATE } |
enum | Visibility { VISIBILITY_NOTSET = -1 , VISIBILITY_MASTER = 0 , VISIBILITY_GLOBAL , MASTER = VISIBILITY_MASTER , GLOBAL = VISIBILITY_GLOBAL } |
Detailed Description
The namespace 'log' contains routines for interacting with the message logger.
Typedef Documentation
◆ Priority
typedef Level bitpit::log::Priority |
Defines the priority levels that can be associated with a line. The usage of this enum is deprecated as it as been superseded by Severity.
Definition at line 78 of file logger.hpp.
◆ Severity
typedef Level bitpit::log::Severity |
Defines the severity levels that can be associated with a line. Severity is defined as a typedef of Level.
Definition at line 77 of file logger.hpp.
◆ Verbosity
typedef Level bitpit::log::Verbosity |
Defines the verbosity levels that can be associated with a logger. The usage of this enum is deprecated as it as been superseded by Level.
Definition at line 79 of file logger.hpp.
Enumeration Type Documentation
◆ Level
enum bitpit::log::Level |
Define the logging levels.
Definition at line 56 of file logger.hpp.
◆ Mode
enum bitpit::log::Mode |
Defines the operational mode of the logger manager.
Enumerator | |
---|---|
COMBINED | In this mode all the loggers will write the messages on the same file. |
SEPARATE | In this mode each logger will write the messages on its own file. |
Definition at line 48 of file logger.hpp.
◆ Visibility
enum bitpit::log::Visibility |
Definition at line 69 of file logger.hpp.
Function Documentation
◆ consoleVerbosity()
LoggerManipulator< log::Level > bitpit::log::consoleVerbosity | ( | const log::Level & | threshold | ) |
Returns a logger manipulator that allows to change the verbosity threshold for the messages printed on the console.
- Parameters
-
threshold is the verbosity threshold
- Returns
- A logger manipulator that allows to change the verbosity for the messages printed on the console.
Definition at line 2102 of file logger.cpp.
◆ context()
LoggerManipulator< std::string > bitpit::log::context | ( | const std::string & | context | ) |
Returns a logger manipulator that allows to change the context of the output.
- Parameters
-
context is the context of the output
- Returns
- A logger manipulator that allows to change the context of the output.
Definition at line 1938 of file logger.cpp.
◆ cout() [1/2]
Logger & bitpit::log::cout | ( | const std::string & | name, |
log::Level | defaultSeverity, | ||
log::Visibility | defaultVisibility ) |
Returns an instance of the specified logger.
The default severity of the messages will be set to the specified level, if no default severity is specified, the default severity will remain unaltered.
The default visibility of the messages will be set to the specified level, if no default visibility is specified, the default visibility will remain unaltered.
- Parameters
-
name is the name of the logger defaultSeverity is the default severity of the messages. defaultVisibility is the default visibility of the messages
- Returns
- An instance of the specified logger.
Definition at line 1735 of file logger.cpp.
◆ cout() [2/2]
Logger & bitpit::log::cout | ( | log::Level | defaultSeverity, |
log::Visibility | defaultVisibility ) |
Returns an instance of the default logger.
The default severity of the messages will be set to the specified level, if no default severity is specified, the default severity will remain unaltered.
The default visibility of the messages will be set to the specified level, if no default visibility is specified, the default visibility will remain unaltered.
- Parameters
-
defaultSeverity is the default severity of the messages. defaultVisibility is the default visibility of the messages.
- Returns
- An instance of the default logger.
- Examples
- POD_application_example_00001.cpp, and RBF_example_00001.cpp.
Definition at line 1714 of file logger.cpp.
◆ critical() [1/2]
Logger & bitpit::log::critical | ( | const std::string & | name, |
log::Visibility | defaultVisibility ) |
Returns an instance of the specified logger.
The default severity of the messages will be set to the CRITICAL level.
The default visibility of the messages will be set to the specified level, if no default visibility is specified, the default visibility will remain unaltered.
- Parameters
-
name is the name of the logger defaultVisibility is the default visibility of the messages
- Returns
- An instance of the specified logger.
Definition at line 1769 of file logger.cpp.
◆ critical() [2/2]
Logger & bitpit::log::critical | ( | log::Visibility | defaultVisibility | ) |
Returns an instance of the default logger.
The default severity of the messages will be set to the CRITICAL level.
The default visibility of the messages will be set to the specified level, if no default visibility is specified, the default visibility will remain unaltered.
- Returns
- An instance of the default logger.
Definition at line 1751 of file logger.cpp.
◆ debug() [1/2]
Logger & bitpit::log::debug | ( | const std::string & | name, |
log::Visibility | defaultVisibility ) |
Returns an instance of the specified logger.
The default severity of the messages will be set to the DEBUG level.
The default visibility of the messages will be set to the specified level, if no default visibility is specified, the default visibility will remain unaltered.
- Parameters
-
name is the name of the logger defaultVisibility is the default visibility of the messages
- Returns
- An instance of the specified logger.
Definition at line 1909 of file logger.cpp.
◆ debug() [2/2]
Logger & bitpit::log::debug | ( | log::Visibility | defaultVisibility | ) |
Returns an instance of the default logger.
The default severity of the messages will be set to the DEBUG level.
The default visibility of the messages will be set to the specified level, if no default visibility is specified, the default visibility will remain unaltered.
- Parameters
-
defaultVisibility is the default visibility of the messages
- Returns
- An instance of the default logger.
Definition at line 1891 of file logger.cpp.
◆ defaultSeverity()
LoggerManipulator< log::Level > bitpit::log::defaultSeverity | ( | const log::Level & | severity | ) |
Returns a logger manipulator that allows to change the default severity of the messages.
- Parameters
-
severity is the default severity of the messages
- Returns
- A logger manipulator that allows to change the severity of the output.
Definition at line 1965 of file logger.cpp.
◆ defaultVisibility()
LoggerManipulator< log::Visibility > bitpit::log::defaultVisibility | ( | const log::Visibility & | visibility | ) |
Returns a logger manipulator that allows to change the default visibility of the messages.
- Parameters
-
visibility is the default visibility of the messages
- Returns
- A logger manipulator that allows to change the priority of the output.
Definition at line 2019 of file logger.cpp.
◆ disable() [1/2]
LoggerManipulator< log::Level > bitpit::log::disable | ( | const log::Level & | level | ) |
Returns a logger manipulator that allows to define an overriding verbosity level which takes precedence over the logger’s own level. The effect of this overriding verbosity level is to disable all logging calls of severity level and below.
- Parameters
-
level is the overriding verbosity level
- Returns
- A logger manipulator that allows to change the verbosity for the messages printed on the console.
Definition at line 2160 of file logger.cpp.
◆ disable() [2/2]
Logger & bitpit::log::disable | ( | Logger & | logger, |
const log::Level & | level ) |
Provides an overriding verbosity level which takes precedence over the logger’s own level. Its effect is to disable all logging calls of severity level and below.
- Parameters
-
logger is a reference pointing to the logger level is the overriding verbosity level
- Returns
- A reference pointing to the logger received in input.
Definition at line 2143 of file logger.cpp.
◆ disableConsole() [1/2]
LoggerManipulator< log::Level > bitpit::log::disableConsole | ( | const log::Level & | level | ) |
Returns a logger manipulator that allows to define an overriding verbosity level which takes precedence over the logger’s own console level. The effect of this overriding verbosity level is to disable all logging calls of severity level and below.
- Parameters
-
level is the overriding verbosity level
- Returns
- A logger manipulator that allows to change the verbosity for the messages printed on the console.
Definition at line 2191 of file logger.cpp.
◆ disableConsole() [2/2]
Logger & bitpit::log::disableConsole | ( | Logger & | logger, |
const log::Level & | level ) |
Provides an overriding verbosity level which takes precedence over the logger’s own console level. Its effect is to disable all logging calls of severity level and below.
- Parameters
-
logger is a reference pointing to the logger level is the overriding verbosity level
- Returns
- A reference pointing to the logger received in input.
Definition at line 2174 of file logger.cpp.
◆ disableFile() [1/2]
LoggerManipulator< log::Level > bitpit::log::disableFile | ( | const log::Level & | level | ) |
Returns a logger manipulator that allows to define an overriding verbosity level which takes precedence over the logger’s own file level. The effect of this overriding verbosity level is to disable all logging calls of severity level and below.
- Parameters
-
level is the overriding verbosity level
- Returns
- A logger manipulator that allows to change the verbosity for the messages printed on the file.
Definition at line 2222 of file logger.cpp.
◆ disableFile() [2/2]
Logger & bitpit::log::disableFile | ( | Logger & | logger, |
const log::Level & | level ) |
Provides an overriding verbosity level which takes precedence over the logger’s own file level. Its effect is to disable all logging calls of severity level and below.
- Parameters
-
logger is a reference pointing to the logger level is the overriding verbosity level
- Returns
- A reference pointing to the logger received in input.
Definition at line 2205 of file logger.cpp.
◆ error() [1/2]
Logger & bitpit::log::error | ( | const std::string & | name, |
log::Visibility | defaultVisibility ) |
Returns an instance of the specified logger.
The default severity of the messages will be set to the ERROR level.
The default visibility of the messages will be set to the specified level, if no default visibility is specified, the default visibility will remain unaltered.
- Parameters
-
name is the name of the logger defaultVisibility is the default visibility of the messages
- Returns
- An instance of the specified logger.
Definition at line 1804 of file logger.cpp.
◆ error() [2/2]
Logger & bitpit::log::error | ( | log::Visibility | defaultVisibility | ) |
Returns an instance of the default logger.
The default severity of the messages will be set to the ERROR level.
The default visibility of the messages will be set to the specified level, if no default visibility is specified, the default visibility will remain unaltered.
- Parameters
-
defaultVisibility is the default visibility of the messages
- Returns
- An instance of the default logger.
Definition at line 1786 of file logger.cpp.
◆ fileVerbosity()
LoggerManipulator< log::Level > bitpit::log::fileVerbosity | ( | const log::Level & | threshold | ) |
Returns a logger manipulator that allows to change the verbosity threshold for the messages printed on the file.
- Parameters
-
threshold is the verbosity threshold
- Returns
- A logger manipulator that allows to change the verbosity for the messages printed on the file.
Definition at line 2129 of file logger.cpp.
◆ indent()
LoggerManipulator< int > bitpit::log::indent | ( | int | delta | ) |
Returns a logger manipulator that allows to set the indentation level of the messages.
- Parameters
-
delta is the relative indentation level
- Returns
- A logger manipulator that allows to set the indentation level of the messages.
Definition at line 2249 of file logger.cpp.
◆ info() [1/2]
Logger & bitpit::log::info | ( | const std::string & | name, |
log::Visibility | defaultVisibility ) |
Returns an instance of the specified logger.
The default severity of the messages will be set to the INFO level.
The default visibility of the messages will be set to the specified level, if no default visibility is specified, the default visibility will remain unaltered.
- Parameters
-
name is the name of the logger defaultVisibility is the default visibility of the messages
- Returns
- An instance of the specified logger.
Definition at line 1874 of file logger.cpp.
◆ info() [2/2]
Logger & bitpit::log::info | ( | log::Visibility | defaultVisibility | ) |
Returns an instance of the default logger.
The default severity of the messages will be set to the INFO level.
The default visibility of the messages will be set to the specified level, if no default visibility is specified, the default visibility will remain unaltered.
- Parameters
-
defaultVisibility is the default visibility of the messages
- Returns
- An instance of the default logger.
Definition at line 1856 of file logger.cpp.
◆ manager()
LoggerManager & bitpit::log::manager | ( | ) |
◆ operator<<()
Logger & bitpit::log::operator<< | ( | Logger & | logger, |
LoggerManipulator< T > && | m ) |
Applies a manipulator to a logger.
Definition at line 367 of file logger.hpp.
◆ priority()
LoggerManipulator< log::Level > bitpit::log::priority | ( | const log::Priority & | priority | ) |
Returns a logger manipulator that allows to change the priority of the output.
- Parameters
-
priority is the priority of the output
- Returns
- A logger manipulator that allows to change the priority of the output.
Definition at line 1992 of file logger.cpp.
◆ setConsoleVerbosity()
Logger & bitpit::log::setConsoleVerbosity | ( | Logger & | logger, |
const log::Level & | threshold ) |
Sets the verbosity threshold for the messages printed on the console.
- Parameters
-
logger is a reference pointing to the logger threshold is the verbosity threshold
- Returns
- A reference pointing to the logger received in input.
- Examples
- POD_application_example_00001.cpp.
Definition at line 2087 of file logger.cpp.
◆ setContext()
Set the context of the output for the specified logger.
- Parameters
-
logger is a reference pointing to the logger context is the context of the output
- Returns
- A reference pointing to the logger received in input.
Definition at line 1923 of file logger.cpp.
◆ setDefaultSeverity()
Logger & bitpit::log::setDefaultSeverity | ( | Logger & | logger, |
const log::Level & | severity ) |
Set the default severity of the messageg for the specified logger.
- Parameters
-
logger is a reference pointing to the logger severity is the default severity of the messages
- Returns
- A reference pointing to the logger received in input.
Definition at line 1950 of file logger.cpp.
◆ setDefaultVisibility()
Set the default visibility of the messages.
- Parameters
-
logger is a reference pointing to the logger visibility is the default visibility of the messages
- Returns
- A reference pointing to the logger received in input.
Definition at line 2004 of file logger.cpp.
◆ setFileVerbosity()
Logger & bitpit::log::setFileVerbosity | ( | Logger & | logger, |
const log::Level & | threshold ) |
Sets the verbosity threshold for the messages printed on the file.
- Parameters
-
logger is a reference pointing to the logger threshold is the verbosity threshold
- Returns
- A reference pointing to the logger received in input.
- Examples
- POD_application_example_00001.cpp.
Definition at line 2114 of file logger.cpp.
◆ setIndentation()
Sets the indentation level of the messages.
- Parameters
-
logger is a reference pointing to the logger delta is the relative indentation level
- Returns
- A reference pointing to the logger received in input.
Definition at line 2234 of file logger.cpp.
◆ setPriority()
Logger & bitpit::log::setPriority | ( | Logger & | logger, |
const log::Priority & | priority ) |
Set the priority of the output for the specified logger.
- Parameters
-
logger is a reference pointing to the logger priority is the priority of the output
- Returns
- A reference pointing to the logger received in input.
Definition at line 1977 of file logger.cpp.
◆ setVerbosities()
Logger & bitpit::log::setVerbosities | ( | Logger & | logger, |
const log::Level & | threshold ) |
Sets the verbosity thresholds for the messages printed both on the console and on the log file.
- Parameters
-
logger is a reference pointing to the logger threshold is the verbosity threshold
- Returns
- A reference pointing to the logger received in input.
Definition at line 2059 of file logger.cpp.
◆ setVisibility()
Set the visibility of the messages.
- Parameters
-
logger is a reference pointing to the logger visibility is the visibility of the messages
- Returns
- A reference pointing to the logger received in input.
Definition at line 2031 of file logger.cpp.
◆ verbosities()
LoggerManipulator< log::Level > bitpit::log::verbosities | ( | const log::Level & | threshold | ) |
Returns a logger manipulator that allows to change the verbosity threshold for the messages printed both on the console and on the log file.
- Parameters
-
threshold is the verbosity threshold
- Returns
- A logger manipulator that allows to change the verbosity for the messages printed on the console.
Definition at line 2075 of file logger.cpp.
◆ visibility()
LoggerManipulator< log::Visibility > bitpit::log::visibility | ( | const log::Visibility & | visibility | ) |
Returns a logger manipulator that allows to change the visibility of the messages.
- Parameters
-
visibility is the visibility of the messages
- Returns
- A logger manipulator that allows to change the priority of the output.
Definition at line 2046 of file logger.cpp.
◆ warning() [1/2]
Logger & bitpit::log::warning | ( | const std::string & | name, |
log::Visibility | defaultVisibility ) |
Returns an instance of the specified logger.
The default severity of the messages will be set to the WARNING level.
The default visibility of the messages will be set to the specified level, if no default visibility is specified, the default visibility will remain unaltered.
- Parameters
-
name is the name of the logger defaultVisibility is the default visibility of the messages
- Returns
- An instance of the specified logger.
Definition at line 1839 of file logger.cpp.
◆ warning() [2/2]
Logger & bitpit::log::warning | ( | log::Visibility | defaultVisibility | ) |
Returns an instance of the default logger.
The default severity of the messages will be set to the WARNING level.
The default visibility of the messages will be set to the specified level, if no default visibility is specified, the default visibility will remain unaltered.
- Parameters
-
defaultVisibility is the default visibility of the messages
- Returns
- An instance of the default logger.
Definition at line 1821 of file logger.cpp.
