ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::Logger Class Reference

class for printing debug output More...

#include <Acts/Utilities/Logger.hpp>

Public Member Functions

 Logger (std::unique_ptr< Logging::OutputPrintPolicy > pPrint, std::unique_ptr< Logging::OutputFilterPolicy > pFilter)
 construct from output print and filter policy
std::unique_ptr< Loggerclone (const std::optional< std::string > &_name=std::nullopt, const std::optional< Logging::Level > &_level=std::nullopt) const
 Make a copy of this logger, optionally changing the name or the level.
std::unique_ptr< Loggerclone (Logging::Level _level) const
 Make a copy of the logger, with a new level.
std::unique_ptr< LoggercloneWithSuffix (const std::string &suffix, std::optional< Logging::Level > _level=std::nullopt) const
 Make a copy of the logger, with a suffix added to the end of it's name.
bool doPrint (const Logging::Level &lvl) const
 decide whether a message with a given debug level has to be printed
const Logging::OutputFilterPolicyfilterPolicy () const
 Return the filter policy for this logger.
Logging::Level level () const
 Return the level of the filter policy of this logger.
void log (const Logging::Level &lvl, const std::string &input) const
 log a debug message
const std::string & name () const
 Return the name of the print policy of this logger.
const Loggeroperator() () const
 Helper function so a logger reference can be used as is with the logging macros.
const Logging::OutputPrintPolicyprintPolicy () const
 Return the print policy for this logger.

Detailed Description

class for printing debug output

This class provides the user interface for printing debug messages with different levels of severity.

Constructor & Destructor Documentation

◆ Logger()

Acts::Logger::Logger ( std::unique_ptr< Logging::OutputPrintPolicy > pPrint,
std::unique_ptr< Logging::OutputFilterPolicy > pFilter )

construct from output print and filter policy

Parameters
[in]pPrintpolicy for printing debug messages
[in]pFilterpolicy for filtering debug messages

Member Function Documentation

◆ clone() [1/2]

std::unique_ptr< Logger > Acts::Logger::clone ( const std::optional< std::string > & _name = std::nullopt,
const std::optional< Logging::Level > & _level = std::nullopt ) const

Make a copy of this logger, optionally changing the name or the level.

Parameters
_namethe optional new name
_levelthe optional new level
Returns
Unique pointer to a cloned logger

◆ clone() [2/2]

std::unique_ptr< Logger > Acts::Logger::clone ( Logging::Level _level) const

Make a copy of the logger, with a new level.

Convenience function for if you only want to change the level but not the name.

Parameters
_levelthe new level
Returns
the new logger

◆ cloneWithSuffix()

std::unique_ptr< Logger > Acts::Logger::cloneWithSuffix ( const std::string & suffix,
std::optional< Logging::Level > _level = std::nullopt ) const

Make a copy of the logger, with a suffix added to the end of it's name.

You can also optionally supply a new level

Parameters
suffixthe suffix to add to the end of the name
_levelthe optional new level
Returns
Unique pointer to a cloned logger with modified name

◆ doPrint()

bool Acts::Logger::doPrint ( const Logging::Level & lvl) const

decide whether a message with a given debug level has to be printed

Parameters
[in]lvldebug level of debug message
Returns
true if debug message should be printed, otherwise false

◆ filterPolicy()

const Logging::OutputFilterPolicy & Acts::Logger::filterPolicy ( ) const

Return the filter policy for this logger.

Returns
the filter policy

◆ level()

Logging::Level Acts::Logger::level ( ) const

Return the level of the filter policy of this logger.

Returns
the level

◆ log()

void Acts::Logger::log ( const Logging::Level & lvl,
const std::string & input ) const

log a debug message

Parameters
[in]lvldebug level of debug message
[in]inputtext of debug message

◆ name()

const std::string & Acts::Logger::name ( ) const

Return the name of the print policy of this logger.

Returns
the name

◆ operator()()

const Logger & Acts::Logger::operator() ( ) const

Helper function so a logger reference can be used as is with the logging macros.

Returns
Reference to this logger

◆ printPolicy()

const Logging::OutputPrintPolicy & Acts::Logger::printPolicy ( ) const

Return the print policy for this logger.

Returns
the print policy