CYCLUS
Classes | Namespaces | Macros | Enumerations
logger.h File Reference
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <map>

Go to the source code of this file.

Classes

class  cyclus::Logger
 

Namespaces

 cyclus
 

Macros

#define CLOG(level)
 
#define LOG(level, prefix)
 
#define MLOG(level)
 

Enumerations

enum  cyclus::LogLevel {
  cyclus::LEV_ERROR, cyclus::LEV_WARN, cyclus::LEV_INFO1, cyclus::LEV_INFO2,
  cyclus::LEV_INFO3, cyclus::LEV_INFO4, cyclus::LEV_INFO5, cyclus::LEV_DEBUG1,
  cyclus::LEV_DEBUG2, cyclus::LEV_DEBUG3, cyclus::LEV_DEBUG4, cyclus::LEV_DEBUG5
}
 

Detailed Description

Code providing rudimentary logging capability for the Cyclus core.

Details outlining proper use of this logging functionality can be found at http://cyclus.github.com/devdoc/main.html

Definition in file logger.h.

Macro Definition Documentation

◆ CLOG

#define CLOG (   level)
Value:
if (level > cyclus::Logger::ReportLevel()) ; \
else cyclus::Logger().Get(level, "core")
static LogLevel & ReportLevel()
Use to get/set the (global) log level report cutoff.
Definition: logger.h:81
A logging tool providing finer grained control over standard output for debugging and other purposes...
Definition: logger.h:70
std::ostringstream & Get(LogLevel level, std::string prefix)
Returns a string stream by reference that is flushed to stdout by the Logger class destructor...
Definition: logger.cc:18

Definition at line 39 of file logger.h.

◆ LOG

#define LOG (   level,
  prefix 
)
Value:
else cyclus::Logger().Get(level, prefix)
static LogLevel & ReportLevel()
Use to get/set the (global) log level report cutoff.
Definition: logger.h:81
A logging tool providing finer grained control over standard output for debugging and other purposes...
Definition: logger.h:70
static bool & NoAgent()
Set whether or not agent/agent log entries should be printed.
Definition: logger.h:92
std::ostringstream & Get(LogLevel level, std::string prefix)
Returns a string stream by reference that is flushed to stdout by the Logger class destructor...
Definition: logger.cc:18

allows easy logging via the streaming operator similar to std::cout; this is the primary way to use the Logging functionality.

Parameters
levelLogLevel category or type of log statement.
prefixA std::string value that functions as a unique identifier for the module. Prefixes longer than 6 characters will be truncated.
Warning
do not place any state-changing expressions with this macro as they may not run if the report level excludes the specified log 'level'.

Definition at line 35 of file logger.h.

◆ MLOG

#define MLOG (   level)
Value:
else cyclus::Logger().Get(level, "memory")
static bool & NoMem()
Set whether or not agent/agent log entries should be printed.
Definition: logger.h:104
static LogLevel & ReportLevel()
Use to get/set the (global) log level report cutoff.
Definition: logger.h:81
A logging tool providing finer grained control over standard output for debugging and other purposes...
Definition: logger.h:70
std::ostringstream & Get(LogLevel level, std::string prefix)
Returns a string stream by reference that is flushed to stdout by the Logger class destructor...
Definition: logger.cc:18

Definition at line 43 of file logger.h.