gem5  v20.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Logger Class Referenceabstract

#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 ()
 
void print (const Loc &loc, const std::string &str)
 
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 () M5_ATTR_NORETURN
 

Static Public Member Functions

static LoggergetPanic ()
 
static LoggergetFatal ()
 
static LoggergetWarn ()
 
static LoggergetInfo ()
 
static LoggergetHack ()
 
static void setLevel (LogLevel ll)
 

Protected Member Functions

virtual void log (const Loc &loc, std::string s)=0
 
virtual void exit ()
 

Protected Attributes

bool enabled
 
const char * prefix
 

Detailed Description

Definition at line 51 of file logging.hh.

Member Enumeration Documentation

◆ LogLevel

Enumerator
PANIC 
FATAL 
WARN 
INFO 
HACK 
NUM_LOG_LEVELS 

Definition at line 62 of file logging.hh.

Constructor & Destructor Documentation

◆ Logger()

Logger::Logger ( const char *  prefix)
inline

Definition at line 84 of file logging.hh.

◆ ~Logger()

virtual Logger::~Logger ( )
inlinevirtual

Definition at line 89 of file logging.hh.

Member Function Documentation

◆ exit()

virtual void Logger::exit ( )
inlineprotectedvirtual

Definition at line 126 of file logging.hh.

Referenced by exit_helper().

◆ exit_helper()

void Logger::exit_helper ( )
inline

Definition at line 120 of file logging.hh.

References exit().

◆ getFatal()

Logger & Logger::getFatal ( )
static

Definition at line 79 of file logging.cc.

Referenced by setLevel().

◆ getHack()

Logger & Logger::getHack ( )
static

Definition at line 82 of file logging.cc.

Referenced by setLevel().

◆ getInfo()

Logger & Logger::getInfo ( )
static

Definition at line 81 of file logging.cc.

Referenced by setLevel().

◆ getPanic()

Logger & Logger::getPanic ( )
static

Definition at line 78 of file logging.cc.

Referenced by setLevel().

◆ getWarn()

Logger & Logger::getWarn ( )
static

Definition at line 80 of file logging.cc.

Referenced by setLevel().

◆ log()

virtual void Logger::log ( const Loc loc,
std::string  s 
)
protectedpure virtual

Referenced by print().

◆ print() [1/3]

void Logger::print ( const Loc loc,
const std::string &  str 
)
inline

Definition at line 92 of file logging.hh.

References enabled, log(), prefix, and ArmISA::ss.

Referenced by print().

◆ print() [2/3]

template<typename ... Args>
void Logger::print ( const Loc loc,
const char *  format,
const Args &...  args 
)
inline

Definition at line 104 of file logging.hh.

References ccprintf(), print(), and ArmISA::ss.

◆ print() [3/3]

template<typename ... Args>
void Logger::print ( const Loc loc,
const std::string &  format,
const Args &...  args 
)
inline

Definition at line 112 of file logging.hh.

References print().

◆ setLevel()

static void Logger::setLevel ( LogLevel  ll)
inlinestatic

Definition at line 68 of file logging.hh.

References enabled, FATAL, getFatal(), getHack(), getInfo(), getPanic(), getWarn(), HACK, INFO, PANIC, and WARN.

Referenced by pybind_init_core().

Member Data Documentation

◆ enabled

bool Logger::enabled
protected

Definition at line 123 of file logging.hh.

Referenced by print(), and setLevel().

◆ prefix

const char* Logger::prefix
protected

Definition at line 128 of file logging.hh.

Referenced by print().


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

Generated on Thu May 28 2020 16:21:47 for gem5 by doxygen 1.8.13