gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
Trace::OstreamLogger Class Reference

Logging wrapper for ostreams with the format: <when>: <name>: <message-body> More...

#include <trace.hh>

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

Public Member Functions

 OstreamLogger (std::ostream &stream_)
 
void logMessage (Tick when, const std::string &name, const std::string &message) override
 Log formatted message. More...
 
std::ostream & getOstream () override
 Return an ostream that can be used to send messages to the 'same place' as formatted logMessage messages. More...
 
- Public Member Functions inherited from Trace::Logger
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...
 
void setIgnore (ObjectMatch &ignore_)
 Set objects to ignore. More...
 
virtual ~Logger ()
 

Protected Attributes

std::ostream & stream
 
- Protected Attributes inherited from Trace::Logger
ObjectMatch ignore
 Name match for objects to ignore. More...
 

Detailed Description

Logging wrapper for ostreams with the format: <when>: <name>: <message-body>

Definition at line 94 of file trace.hh.

Constructor & Destructor Documentation

Trace::OstreamLogger::OstreamLogger ( std::ostream &  stream_)
inline

Definition at line 100 of file trace.hh.

Member Function Documentation

std::ostream& Trace::OstreamLogger::getOstream ( )
inlineoverridevirtual

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

Implements Trace::Logger.

Definition at line 106 of file trace.hh.

References stream.

void Trace::OstreamLogger::logMessage ( Tick  when,
const std::string &  name,
const std::string &  message 
)
overridevirtual

Log formatted message.

Implements Trace::Logger.

Definition at line 144 of file trace.cc.

References ccprintf(), Trace::Logger::ignore, ObjectMatch::match(), MaxTick, and stream.

Member Data Documentation

std::ostream& Trace::OstreamLogger::stream
protected

Definition at line 97 of file trace.hh.

Referenced by getOstream(), and logMessage().


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