Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions
bitpit::log Namespace Reference

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
}
 

Functions

LoggerManipulator< log::LevelconsoleVerbosity (const log::Level &threshold)
 
LoggerManipulator< std::string > context (const std::string &context)
 
Loggercout (const std::string &name, log::Level defaultSeverity, log::Visibility defaultVisibility)
 
Loggercout (log::Level defaultSeverity, log::Visibility defaultVisibility)
 
Loggercritical (const std::string &name, log::Visibility defaultVisibility)
 
Loggercritical (log::Visibility defaultVisibility)
 
Loggerdebug (const std::string &name, log::Visibility defaultVisibility)
 
Loggerdebug (log::Visibility defaultVisibility)
 
LoggerManipulator< log::LeveldefaultSeverity (const log::Level &severity)
 
LoggerManipulator< log::Visibility > defaultVisibility (const log::Visibility &visibility)
 
LoggerManipulator< log::Leveldisable (const log::Level &level)
 
Loggerdisable (Logger &logger, const log::Level &level)
 
LoggerManipulator< log::LeveldisableConsole (const log::Level &level)
 
LoggerdisableConsole (Logger &logger, const log::Level &level)
 
LoggerManipulator< log::LeveldisableFile (const log::Level &level)
 
LoggerdisableFile (Logger &logger, const log::Level &level)
 
Loggererror (const std::string &name, log::Visibility defaultVisibility)
 
Loggererror (log::Visibility defaultVisibility)
 
LoggerManipulator< log::LevelfileVerbosity (const log::Level &threshold)
 
LoggerManipulator< int > indent (int delta)
 
Loggerinfo (const std::string &name, log::Visibility defaultVisibility)
 
Loggerinfo (log::Visibility defaultVisibility)
 
LoggerManagermanager ()
 
template<typename T >
Loggeroperator<< (Logger &logger, LoggerManipulator< T > &&m)
 
LoggerManipulator< log::Prioritypriority (const log::Priority &priority)
 
LoggersetConsoleVerbosity (Logger &logger, const log::Level &threshold)
 
LoggersetContext (Logger &logger, const std::string &context)
 
LoggersetDefaultSeverity (Logger &logger, const log::Level &severity)
 
LoggersetDefaultVisibility (Logger &logger, const log::Visibility &visibility)
 
LoggersetFileVerbosity (Logger &logger, const log::Level &threshold)
 
LoggersetIndentation (Logger &logger, const int &delta)
 
LoggersetPriority (Logger &logger, const log::Priority &priority)
 
LoggersetVerbosities (Logger &logger, const log::Level &threshold)
 
LoggersetVisibility (Logger &logger, const log::Visibility &visibility)
 
LoggerManipulator< log::Levelverbosities (const log::Level &threshold)
 
LoggerManipulator< log::Visibility > visibility (const log::Visibility &visibility)
 
Loggerwarning (const std::string &name, log::Visibility defaultVisibility)
 
Loggerwarning (log::Visibility defaultVisibility)
 

Detailed Description

The namespace 'log' contains routines for interacting with the message logger.

Typedef Documentation

◆ 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

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

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

Define the logging levels.

Enumerator
QUIET 

This level identifies messages that will not be written. The usage of this level is deprecated, logging can be disabled using the functions disable, disableConsole and disableFile.

NORMAL 

This level identifies messages categorized as information. The usage of this level is deprecated as it as been superseded by INFO.

DEBUG 

This level identifies messages categorized as debug.

Definition at line 56 of file logger.hpp.

◆ 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
thresholdis the verbosity threshold
Returns
A logger manipulator that allows to change the verbosity for the messages printed on the console.

Definition at line 2093 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
contextis the context of the output
Returns
A logger manipulator that allows to change the context of the output.

Definition at line 1929 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
nameis the name of the logger
defaultSeverityis the default severity of the messages.
defaultVisibilityis the default visibility of the messages
Returns
An instance of the specified logger.

Definition at line 1726 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
defaultSeverityis the default severity of the messages.
defaultVisibilityis 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 1705 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
nameis the name of the logger
defaultVisibilityis the default visibility of the messages
Returns
An instance of the specified logger.

Definition at line 1760 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 1742 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
nameis the name of the logger
defaultVisibilityis the default visibility of the messages
Returns
An instance of the specified logger.

Definition at line 1900 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
defaultVisibilityis the default visibility of the messages
Returns
An instance of the default logger.

Definition at line 1882 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
severityis the default severity of the messages
Returns
A logger manipulator that allows to change the severity of the output.

Definition at line 1956 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
visibilityis the default visibility of the messages
Returns
A logger manipulator that allows to change the priority of the output.

Definition at line 2010 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
levelis the overriding verbosity level
Returns
A logger manipulator that allows to change the verbosity for the messages printed on the console.

Definition at line 2151 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
loggeris a reference pointing to the logger
levelis the overriding verbosity level
Returns
A reference pointing to the logger received in input.

Definition at line 2134 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
levelis the overriding verbosity level
Returns
A logger manipulator that allows to change the verbosity for the messages printed on the console.

Definition at line 2182 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
loggeris a reference pointing to the logger
levelis the overriding verbosity level
Returns
A reference pointing to the logger received in input.

Definition at line 2165 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
levelis the overriding verbosity level
Returns
A logger manipulator that allows to change the verbosity for the messages printed on the file.

Definition at line 2213 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
loggeris a reference pointing to the logger
levelis the overriding verbosity level
Returns
A reference pointing to the logger received in input.

Definition at line 2196 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
nameis the name of the logger
defaultVisibilityis the default visibility of the messages
Returns
An instance of the specified logger.

Definition at line 1795 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
defaultVisibilityis the default visibility of the messages
Returns
An instance of the default logger.

Definition at line 1777 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
thresholdis the verbosity threshold
Returns
A logger manipulator that allows to change the verbosity for the messages printed on the file.

Definition at line 2120 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
deltais the relative indentation level
Returns
A logger manipulator that allows to set the indentation level of the messages.

Definition at line 2240 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
nameis the name of the logger
defaultVisibilityis the default visibility of the messages
Returns
An instance of the specified logger.

Definition at line 1865 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
defaultVisibilityis the default visibility of the messages
Returns
An instance of the default logger.

Definition at line 1847 of file logger.cpp.

◆ manager()

LoggerManager & bitpit::log::manager ( )

Returns the logger manager.

Returns
The logger manager.

Definition at line 1685 of file logger.cpp.

◆ operator<<()

template<typename T >
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
priorityis the priority of the output
Returns
A logger manipulator that allows to change the priority of the output.

Definition at line 1983 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
loggeris a reference pointing to the logger
thresholdis the verbosity threshold
Returns
A reference pointing to the logger received in input.
Examples
POD_application_example_00001.cpp.

Definition at line 2078 of file logger.cpp.

◆ setContext()

Logger & bitpit::log::setContext ( Logger & logger,
const std::string & context )

Set the context of the output for the specified logger.

Parameters
loggeris a reference pointing to the logger
contextis the context of the output
Returns
A reference pointing to the logger received in input.

Definition at line 1914 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
loggeris a reference pointing to the logger
severityis the default severity of the messages
Returns
A reference pointing to the logger received in input.

Definition at line 1941 of file logger.cpp.

◆ setDefaultVisibility()

Logger & bitpit::log::setDefaultVisibility ( Logger & logger,
const log::Visibility & visibility )

Set the default visibility of the messages.

Parameters
loggeris a reference pointing to the logger
visibilityis the default visibility of the messages
Returns
A reference pointing to the logger received in input.

Definition at line 1995 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
loggeris a reference pointing to the logger
thresholdis the verbosity threshold
Returns
A reference pointing to the logger received in input.
Examples
POD_application_example_00001.cpp.

Definition at line 2105 of file logger.cpp.

◆ setIndentation()

Logger & bitpit::log::setIndentation ( Logger & logger,
const int & delta )

Sets the indentation level of the messages.

Parameters
loggeris a reference pointing to the logger
deltais the relative indentation level
Returns
A reference pointing to the logger received in input.

Definition at line 2225 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
loggeris a reference pointing to the logger
priorityis the priority of the output
Returns
A reference pointing to the logger received in input.

Definition at line 1968 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
loggeris a reference pointing to the logger
thresholdis the verbosity threshold
Returns
A reference pointing to the logger received in input.

Definition at line 2050 of file logger.cpp.

◆ setVisibility()

Logger & bitpit::log::setVisibility ( Logger & logger,
const log::Visibility & visibility )

Set the visibility of the messages.

Parameters
loggeris a reference pointing to the logger
visibilityis the visibility of the messages
Returns
A reference pointing to the logger received in input.

Definition at line 2022 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
thresholdis the verbosity threshold
Returns
A logger manipulator that allows to change the verbosity for the messages printed on the console.

Definition at line 2066 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
visibilityis the visibility of the messages
Returns
A logger manipulator that allows to change the priority of the output.

Definition at line 2037 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
nameis the name of the logger
defaultVisibilityis the default visibility of the messages
Returns
An instance of the specified logger.

Definition at line 1830 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
defaultVisibilityis the default visibility of the messages
Returns
An instance of the default logger.

Definition at line 1812 of file logger.cpp.

--- layout: doxygen_footer ---