CYCLUS
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
cyclus::Logger Class Reference

Detailed Description

A logging tool providing finer grained control over standard output for debugging and other purposes.

Warning
do not place any state-changing expressions with the LOG macro as they may not run if the report level excludes the specified level.

Definition at line 70 of file logger.h.

#include <logger.h>

Public Member Functions

std::ostringstream & Get (LogLevel level, std::string prefix)
 
 Logger ()
 
virtual ~Logger ()
 

Static Public Member Functions

static bool & NoAgent ()
 
static bool & NoMem ()
 
static LogLevelReportLevel ()
 
static LogLevel ToLogLevel (std::string text)
 
static std::string ToString (LogLevel level)
 

Protected Attributes

std::ostringstream os
 

Constructor & Destructor Documentation

cyclus::Logger::Logger ( )
inline

Definition at line 72 of file logger.h.

cyclus::Logger::~Logger ( )
virtual

Definition at line 35 of file logger.cc.

Member Function Documentation

std::ostringstream & cyclus::Logger::Get ( LogLevel  level,
std::string  prefix 
)

Returns a string stream by reference that is flushed to stdout by the Logger class destructor.

Definition at line 18 of file logger.cc.

static bool& cyclus::Logger::NoAgent ( )
inlinestatic

Set whether or not agent/agent log entries should be printed.

Definition at line 86 of file logger.h.

static bool& cyclus::Logger::NoMem ( )
inlinestatic

Set whether or not agent/agent log entries should be printed.

Definition at line 91 of file logger.h.

static LogLevel& cyclus::Logger::ReportLevel ( )
inlinestatic

Use to get/set the (global) log level report cutoff.

Returns
the report level cutoff by reference

Definition at line 81 of file logger.h.

LogLevel cyclus::Logger::ToLogLevel ( std::string  text)
static

Converts a string into a corresponding LogLevel value.

For strings that do not correspond to any particular LogLevel enum value, the method returns the LogLevel value LEV_ERROR. This method is primarily intended for translating command line verbosity argument(s) into appropriate report levels. LOG(level) statements

Definition at line 59 of file logger.cc.

std::string cyclus::Logger::ToString ( LogLevel  level)
static

Converts a LogLevel enum value into a corrsponding string.

For a level argments that have no corresponding string value, the string BAD_LEVEL is returned. This method is primarily intended for translating LOG(level) statement levels into appropriate strings for output to stdout.

Definition at line 68 of file logger.cc.

Member Data Documentation

std::ostringstream cyclus::Logger::os
protected

Definition at line 111 of file logger.h.


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