gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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...
 
virtual void dump (Tick when, const std::string &name, const void *d, int len)
 Dump a block of data of length len. More...
 
virtual void logMessage (Tick when, const std::string &name, 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...
 
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 51 of file trace.hh.

Constructor & Destructor Documentation

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

Definition at line 89 of file trace.hh.

Member Function Documentation

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 60 of file trace.hh.

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

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

Dump a block of data of length len.

Definition at line 105 of file trace.cc.

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

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().

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

Log formatted message.

Implemented in Trace::OstreamLogger.

Referenced by dprintf(), and dump().

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

Set objects to ignore.

Definition at line 87 of file trace.hh.

References ignore.

Referenced by ignore().

Member Data Documentation

ObjectMatch Trace::Logger::ignore
protected

Name match for objects to ignore.

Definition at line 55 of file trace.hh.

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


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

Generated on Fri Jun 9 2017 13:04:40 for gem5 by doxygen 1.8.6