#include <Logging.h>
|
| Logger (bool debugEnabled) |
|
virtual | ~Logger ()=default |
|
bool | getDebugEnabled () |
|
virtual void | log (Level level, const std::string &subsystem, const std::string &msg, const std::map< std::string, std::any > *details=nullptr)=0 |
| Report a log message. More...
|
|
virtual void | error (const std::string &subsystem, const std::string &msg, const std::map< std::string, std::any > *details=nullptr) |
| Report an error. More...
|
|
virtual void | warning (const std::string &subsystem, const std::string &msg, const std::map< std::string, std::any > *details=nullptr) |
| Report a warning. More...
|
|
virtual void | info (const std::string &subsystem, const std::string &msg, const std::map< std::string, std::any > *details=nullptr) |
| Report an informational message. More...
|
|
void | debug (const std::string &subsystem, const std::string &msg, const std::map< std::string, std::any > *details=nullptr) |
| Report a debug message. More...
|
|
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. More...
|
|
|
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. More...
|
|
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. More...
|
|
Definition at line 35 of file Logging.h.
◆ Level
Enumerator |
---|
Debug | |
Info | |
Warning | |
Error | |
Definition at line 37 of file Logging.h.
◆ Logger()
esi::Logger::Logger |
( |
bool |
debugEnabled | ) |
|
|
inline |
◆ ~Logger()
virtual esi::Logger::~Logger |
( |
| ) |
|
|
virtualdefault |
◆ debug() [1/2]
void esi::Logger::debug |
( |
const std::string & |
subsystem, |
|
|
const std::string & |
msg, |
|
|
const std::map< std::string, std::any > * |
details = nullptr |
|
) |
| |
|
inline |
◆ debug() [2/2]
void esi::Logger::debug |
( |
std::function< void(std::string &subsystem, std::string &msg, std::unique_ptr< std::map< std::string, std::any >> &details)> |
debugFunc | ) |
|
|
inline |
Call the debug function callback only if debug is enabled then log a debug message.
Allows users to run heavy weight debug message generation code only when debug is enabled, which in turns allows users to provide fully-featured debug messages in Release builds with minimal performance impact. Not virtual so that it can be inlined.
Definition at line 90 of file Logging.h.
References debugEnabled, and debugImpl().
Referenced by esi-cosim.Verilator::compile_commands(), and esi-cosim.Simulator::run().
◆ debugImpl() [1/2]
virtual void esi::Logger::debugImpl |
( |
const std::string & |
subsystem, |
|
|
const std::string & |
msg, |
|
|
const std::map< std::string, std::any > * |
details |
|
) |
| |
|
inlineprotectedvirtual |
◆ debugImpl() [2/2]
virtual void esi::Logger::debugImpl |
( |
std::function< void(std::string &subsystem, std::string &msg, std::unique_ptr< std::map< std::string, std::any >> &details)> |
debugFunc | ) |
|
|
inlineprotectedvirtual |
◆ error()
virtual void esi::Logger::error |
( |
const std::string & |
subsystem, |
|
|
const std::string & |
msg, |
|
|
const std::map< std::string, std::any > * |
details = nullptr |
|
) |
| |
|
inlinevirtual |
◆ getDebugEnabled()
bool esi::Logger::getDebugEnabled |
( |
| ) |
|
|
inline |
◆ info()
virtual void esi::Logger::info |
( |
const std::string & |
subsystem, |
|
|
const std::string & |
msg, |
|
|
const std::map< std::string, std::any > * |
details = nullptr |
|
) |
| |
|
inlinevirtual |
◆ log()
virtual void esi::Logger::log |
( |
Level |
level, |
|
|
const std::string & |
subsystem, |
|
|
const std::string & |
msg, |
|
|
const std::map< std::string, std::any > * |
details = nullptr |
|
) |
| |
|
pure virtual |
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.
Implemented in esi::NullLogger, and esi::TSLogger.
Referenced by debugImpl(), error(), info(), and warning().
◆ warning()
virtual void esi::Logger::warning |
( |
const std::string & |
subsystem, |
|
|
const std::string & |
msg, |
|
|
const std::map< std::string, std::any > * |
details = nullptr |
|
) |
| |
|
inlinevirtual |
◆ debugEnabled
bool esi::Logger::debugEnabled = false |
|
protected |
The documentation for this class was generated from the following file:
- /home/runner/work/circt-www/circt-www/circt_src/lib/Dialect/ESI/runtime/cpp/include/esi/Logging.h