Class Acts::LoggerWrapper

class Acts::LoggerWrapper

Class that contains (but doesn’t own) a logger instance.

Is callable so can be used with the logging macros.

Public Functions

LoggerWrapper() = delete
explicit LoggerWrapper(const Logger &logger)

Constructor ensuring a logger instance is given.

Parameters

logger

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

Directly expose whether the contained logger will print at a level.

Parameters

lvl – The level to check

Returns

Whether to print at this level or not.

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

Add a logging message at a given level.

Parameters
  • lvl – The level to print at

  • input – text of debug message

const Logger &operator()() const

Call operator that returns the contained logger instance.

Enables using the logging macros ACTS_* when an instance of this class is assigned to a local variable logger.

Returns

Reference to the logger instance.