gem5  v20.1.0.0
Public Member Functions | Protected Attributes | List of all members
Trace::Logger Class Referenceabstract

Debug logging base class. More...

#include <trace.hh>

Inheritance diagram for Trace::Logger:
Trace::OstreamLogger

Public Member Functions

template<typename ... Args>
void dprintf (Tick when, const std::string &name, const char *fmt, const Args &...args)
 Log a single message. More...
 
template<typename ... Args>
void dprintf_flag (Tick when, const std::string &name, const std::string &flag, const char *fmt, const Args &...args)
 Log a single message with a flag prefix. More...
 
void dump (Tick when, const std::string &name, const void *d, int len, const std::string &flag)
 Dump a block of data of length len. More...
 
virtual void logMessage (Tick when, const std::string &name, const std::string &flag, const std::string &message)=0
 Log formatted message. More...
 
virtual std::ostream & getOstream ()=0
 Return an ostream that can be used to send messages to the 'same place' as formatted logMessage messages. More...
 
void setIgnore (ObjectMatch &ignore_)
 Set objects to ignore. More...
 
void addIgnore (const ObjectMatch &ignore_)
 Add objects to ignore. More...
 
virtual ~Logger ()
 

Protected Attributes

ObjectMatch ignore
 Name match for objects to ignore. More...
 

Detailed Description

Debug logging base class.

Handles formatting and outputting time/name/message messages

Definition at line 47 of file trace.hh.

Constructor & Destructor Documentation

◆ ~Logger()

virtual Trace::Logger::~Logger ( )
inlinevirtual

Definition at line 96 of file trace.hh.

Member Function Documentation

◆ addIgnore()

void Trace::Logger::addIgnore ( const ObjectMatch ignore_)
inline

Add objects to ignore.

Definition at line 94 of file trace.hh.

References ObjectMatch::add(), and ignore.

Referenced by ignore().

◆ dprintf()

template<typename ... Args>
void Trace::Logger::dprintf ( Tick  when,
const std::string &  name,
const char *  fmt,
const Args &...  args 
)
inline

Log a single message.

Definition at line 56 of file trace.hh.

References dprintf_flag(), and name().

◆ dprintf_flag()

template<typename ... Args>
void Trace::Logger::dprintf_flag ( Tick  when,
const std::string &  name,
const std::string &  flag,
const char *  fmt,
const Args &...  args 
)
inline

Log a single message with a flag prefix.

Definition at line 64 of file trace.hh.

References ccprintf(), ignore, logMessage(), ObjectMatch::match(), and name().

Referenced by dprintf(), and Trace::ExeTracerRecord::traceInst().

◆ dump()

void Logger::dump ( Tick  when,
const std::string &  name,
const void *  d,
int  len,
const std::string &  flag 
)

Dump a block of data of length len.

Definition at line 107 of file trace.cc.

References ArmISA::c, ccprintf(), ArmISA::d, data, ArmISA::i, ignore, ArmISA::j, ArmISA::len, logMessage(), ObjectMatch::match(), and name().

◆ getOstream()

virtual std::ostream& Trace::Logger::getOstream ( )
pure virtual

Return an ostream that can be used to send messages to the 'same place' as formatted logMessage messages.

This can be implemented to use a logger's underlying ostream, to provide an ostream which formats the output in some way, or just set to one of std::cout, std::cerr

Implemented in Trace::OstreamLogger.

Referenced by Trace::output().

◆ logMessage()

virtual void Trace::Logger::logMessage ( Tick  when,
const std::string &  name,
const std::string &  flag,
const std::string &  message 
)
pure virtual

Log formatted message.

Implemented in Trace::OstreamLogger.

Referenced by dprintf_flag(), and dump().

◆ setIgnore()

void Trace::Logger::setIgnore ( ObjectMatch ignore_)
inline

Set objects to ignore.

Definition at line 91 of file trace.hh.

References ignore.

Member Data Documentation

◆ ignore

ObjectMatch Trace::Logger::ignore
protected

Name match for objects to ignore.

Definition at line 51 of file trace.hh.

Referenced by addIgnore(), dprintf_flag(), dump(), Trace::OstreamLogger::logMessage(), and setIgnore().


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

Generated on Wed Sep 30 2020 14:03:14 for gem5 by doxygen 1.8.17