CIRCT 24.0.0git
Loading...
Searching...
No Matches
esi::NullLogger Class Reference

A logger that does nothing. More...

#include <Logging.h>

Inheritance diagram for esi::NullLogger:
Collaboration diagram for esi::NullLogger:

Public Member Functions

 NullLogger ()
void log (Level, const std::string &, const std::string &, const std::map< std::string, std::any > *) override
 Report a log message.
Public Member Functions inherited from esi::Logger
 Logger (bool debugEnabled, bool traceEnabled)
virtual ~Logger ()=default
bool getDebugEnabled ()
bool getTraceEnabled ()
virtual void error (const std::string &subsystem, const std::string &msg, const std::map< std::string, std::any > *details=nullptr)
 Report an error.
virtual void warning (const std::string &subsystem, const std::string &msg, const std::map< std::string, std::any > *details=nullptr)
 Report a warning.
virtual void info (const std::string &subsystem, const std::string &msg, const std::map< std::string, std::any > *details=nullptr)
 Report an informational message.
void debug (const std::string &subsystem, const std::string &msg, const std::map< std::string, std::any > *details=nullptr)
 Report a debug message.
void debug (std::function< void(std::string &subsystem, std::string &msg, std::unique_ptr< std::map< std::string, std::any > > &details)> debugFunc)
 Call the debug function callback only if debug is enabled then log a debug message.
void trace (const std::string &subsystem, const std::string &msg, const std::map< std::string, std::any > *details=nullptr)
 Log a trace message.
void trace (std::function< void(std::string &subsystem, std::string &msg, std::unique_ptr< std::map< std::string, std::any > > &details)> traceFunc)
 Log a trace message using a callback.

Additional Inherited Members

Public Types inherited from esi::Logger
enum class  Level {
  Trace , Debug , Info , Warning ,
  Error
}
Protected Member Functions inherited from esi::Logger
virtual void debugImpl (const std::string &subsystem, const std::string &msg, const std::map< std::string, std::any > *details)
 Overrideable version of debug. Only gets called if debug is enabled.
virtual void debugImpl (std::function< void(std::string &subsystem, std::string &msg, std::unique_ptr< std::map< std::string, std::any > > &details)> debugFunc)
 Overrideable version of debug. Only gets called if debug is enabled.
Protected Attributes inherited from esi::Logger
bool debugEnabled = false
 Enable or disable debug messages.
bool traceEnabled
 Enable or disable trace messages.

Detailed Description

A logger that does nothing.

Definition at line 219 of file Logging.h.

Constructor & Destructor Documentation

◆ NullLogger()

esi::NullLogger::NullLogger ( )
inline

Definition at line 221 of file Logging.h.

References esi::Logger::Logger().

Member Function Documentation

◆ log()

void esi::NullLogger::log ( Level level,
const std::string & subsystem,
const std::string & msg,
const std::map< std::string, std::any > * details )
inlineoverridevirtual

Report a log message.

Arguments: level: The log level as defined by the 'Level' enum above. subsystem: The subsystem that generated the log message. msg: The log message. details: Optional additional structured details to include in the log message. If there are no details, this should be nullptr.

Implements esi::Logger.

Definition at line 222 of file Logging.h.


The documentation for this class was generated from the following file: