gem5 v24.0.0.0
|
#include <logging.hh>
Classes | |
struct | Loc |
Public Types | |
enum | LogLevel { PANIC , FATAL , WARN , INFO , HACK , NUM_LOG_LEVELS } |
Public Member Functions | |
Logger (const char *prefix) | |
virtual | ~Logger () |
template<typename ... Args> | |
void | print (const Loc &loc, const char *format, const Args &...args) |
template<typename ... Args> | |
void | print (const Loc &loc, const std::string &format, const Args &...args) |
void | exit_helper () |
This helper is necessary since noreturn isn't inherited by virtual functions, and gcc will get mad if a function calls panic and then doesn't return. | |
Static Public Member Functions | |
static Logger & | getPanic () |
Get a Logger for the specified type of message. | |
static Logger & | getFatal () |
static Logger & | getWarn () |
static Logger & | getInfo () |
static Logger & | getHack () |
static void | setLevel (LogLevel ll) |
Protected Member Functions | |
virtual void | log (const Loc &loc, std::string s) |
Generates the log message. | |
virtual void | exit () |
Protected Attributes | |
bool | enabled |
const char * | prefix |
Definition at line 54 of file logging.hh.
Enumerator | |
---|---|
PANIC | |
FATAL | |
WARN | |
INFO | |
HACK | |
NUM_LOG_LEVELS |
Definition at line 67 of file logging.hh.
|
inline |
|
inlinevirtual |
Definition at line 95 of file logging.hh.
|
inlineprotectedvirtual |
Definition at line 136 of file logging.hh.
Referenced by exit_helper().
|
inline |
This helper is necessary since noreturn isn't inherited by virtual functions, and gcc will get mad if a function calls panic and then doesn't return.
Definition at line 124 of file logging.hh.
References exit().
|
static |
Definition at line 84 of file logging_mock.cc.
Referenced by setLevel(), TEST(), and TEST_F().
|
static |
Definition at line 102 of file logging_mock.cc.
Referenced by setLevel(), TEST(), and TEST_F().
|
static |
Definition at line 96 of file logging_mock.cc.
Referenced by setLevel(), TEST(), and TEST_F().
|
static |
Get a Logger for the specified type of message.
Definition at line 78 of file logging_mock.cc.
Referenced by setLevel(), TEST(), and TEST_F().
|
static |
Definition at line 90 of file logging_mock.cc.
Referenced by setLevel(), TEST(), and TEST_F().
|
inlineprotectedvirtual |
Generates the log message.
By default it is sent to cerr.
Definition at line 131 of file logging.hh.
References gem5::Logger::Loc::file, gem5::Logger::Loc::line, and gem5::ArmISA::s.
Referenced by print().
|
inline |
Definition at line 98 of file logging.hh.
References gem5::ccprintf(), enabled, gem5::ArmISA::format, log(), prefix, and gem5::ArmISA::ss.
Referenced by print(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Definition at line 114 of file logging.hh.
References gem5::ArmISA::format, and print().
|
inlinestatic |
Definition at line 74 of file logging.hh.
References enabled, FATAL, getFatal(), getHack(), getInfo(), getPanic(), getWarn(), HACK, INFO, PANIC, and WARN.
Referenced by gem5::pybind_init_core(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
protected |
Definition at line 127 of file logging.hh.
Referenced by print(), and setLevel().
|
protected |
Definition at line 138 of file logging.hh.