CYCLUS
Loading...
Searching...
No Matches
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 boolNoAgent ()
 
static boolNoMem ()
 
static LogLevelReportLevel ()
 
static void SetNoAgent (bool na)
 
static void SetNoMem (bool nm)
 
static void SetReportLevel (LogLevel level)
 
static LogLevel ToLogLevel (std::string text)
 
static std::string ToString (LogLevel level)
 

Protected Attributes

std::ostringstream os
 

Constructor & Destructor Documentation

◆ Logger()

cyclus::Logger::Logger ( )
inline

Definition at line 72 of file logger.h.

◆ ~Logger()

cyclus::Logger::~Logger ( )
virtual

Definition at line 35 of file logger.cc.

Member Function Documentation

◆ Get()

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.

◆ NoAgent()

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

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

Definition at line 92 of file logger.h.

◆ NoMem()

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

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

Definition at line 104 of file logger.h.

◆ ReportLevel()

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.

◆ SetNoAgent()

static void cyclus::Logger::SetNoAgent ( bool na)
inlinestatic

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

This is here because Cython cannot assign to a reference from a function return yet.

Definition at line 99 of file logger.h.

◆ SetNoMem()

static void cyclus::Logger::SetNoMem ( bool nm)
inlinestatic

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

This is here because Cython cannot assign to a reference from a function return yet.

Definition at line 111 of file logger.h.

◆ SetReportLevel()

static void cyclus::Logger::SetReportLevel ( LogLevel level)
inlinestatic

Sets the report level.

This is here because Cython cannot assign to a reference from a function return yet.

Definition at line 87 of file logger.h.

◆ ToLogLevel()

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.

◆ ToString()

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

◆ os

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

Definition at line 131 of file logger.h.


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