gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::trace::Logger Class Referenceabstract

Debug logging base class. More...

#include <trace.hh>

Inheritance diagram for gem5::trace::Logger:
gem5::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.
 
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.
 
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.
 
virtual void logMessage (Tick when, const std::string &name, const std::string &flag, const std::string &message)=0
 Log formatted message.
 
virtual std::ostream & getOstream ()=0
 Return an ostream that can be used to send messages to the 'same place' as formatted logMessage messages.
 
void setIgnore (ObjectMatch &ignore_)
 Set objects to ignore.
 
void addIgnore (const ObjectMatch &ignore_)
 Add objects to ignore.
 
void setActivate (ObjectMatch &activate_)
 Set objects to activate.
 
void addActivate (const ObjectMatch &activate_)
 Add objects to activate.
 
virtual ~Logger ()
 

Protected Member Functions

bool isEnabled (const std::string &name) const
 

Protected Attributes

ObjectMatch ignore
 Name match for objects to ignore.
 
ObjectMatch activate
 Name match for objects to activate log.
 

Detailed Description

Debug logging base class.

Handles formatting and outputting time/name/message messages

Definition at line 59 of file trace.hh.

Constructor & Destructor Documentation

◆ ~Logger()

virtual gem5::trace::Logger::~Logger ( )
inlinevirtual

Definition at line 131 of file trace.hh.

Member Function Documentation

◆ addActivate()

void gem5::trace::Logger::addActivate ( const ObjectMatch & activate_)
inline

Add objects to activate.

Definition at line 129 of file trace.hh.

References activate, and gem5::ObjectMatch::add().

Referenced by TEST().

◆ addIgnore()

void gem5::trace::Logger::addIgnore ( const ObjectMatch & ignore_)
inline

Add objects to ignore.

Definition at line 123 of file trace.hh.

References gem5::ObjectMatch::add(), and ignore.

Referenced by TEST().

◆ dprintf()

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

Log a single message.

Definition at line 85 of file trace.hh.

References dprintf_flag(), and name().

Referenced by TEST(), TEST(), and TEST().

◆ dprintf_flag()

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

◆ dump()

void gem5::trace::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 108 of file trace.cc.

References gem5::ArmISA::c, gem5::ccprintf(), gem5::ArmISA::d, data, gem5::ArmISA::i, isEnabled(), gem5::ArmISA::len, logMessage(), and name().

Referenced by TEST(), TEST(), and TEST().

◆ getOstream()

virtual std::ostream & gem5::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 gem5::trace::OstreamLogger.

Referenced by getString(), and gem5::trace::output().

◆ isEnabled()

bool gem5::trace::Logger::isEnabled ( const std::string & name) const
inlineprotected

◆ logMessage()

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

Log formatted message.

Implemented in gem5::trace::OstreamLogger.

Referenced by dprintf_flag(), dump(), TEST(), and TEST().

◆ setActivate()

void gem5::trace::Logger::setActivate ( ObjectMatch & activate_)
inline

Set objects to activate.

Definition at line 126 of file trace.hh.

References activate.

Referenced by TEST(), TEST(), and TEST().

◆ setIgnore()

void gem5::trace::Logger::setIgnore ( ObjectMatch & ignore_)
inline

Set objects to ignore.

Definition at line 120 of file trace.hh.

References ignore.

Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

Member Data Documentation

◆ activate

ObjectMatch gem5::trace::Logger::activate
protected

Name match for objects to activate log.

Definition at line 65 of file trace.hh.

Referenced by addActivate(), isEnabled(), and setActivate().

◆ ignore

ObjectMatch gem5::trace::Logger::ignore
protected

Name match for objects to ignore.

Definition at line 63 of file trace.hh.

Referenced by addIgnore(), isEnabled(), and setIgnore().


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

Generated on Tue Jun 18 2024 16:24:24 for gem5 by doxygen 1.11.0