9#ifndef CYCLUS_SRC_LOGGER_H_
10#define CYCLUS_SRC_LOGGER_H_
34#define LOG(level, prefix) \
35 if ((level > cyclus::Logger::ReportLevel()) | cyclus::Logger::NoAgent()) \
38 cyclus::Logger().Get(level, prefix)
41 if (level > cyclus::Logger::ReportLevel()) \
44 cyclus::Logger().Get(level, "core")
47 if ((level > cyclus::Logger::ReportLevel()) | cyclus::Logger::NoMem()) \
50 cyclus::Logger().Get(level, "memory")
89 std::ostringstream&
Get(
LogLevel level, std::string prefix);
108 static bool&
NoMem() {
return no_mem; }
132 std::ostringstream
os;
144 static bool no_agent;
150 static std::vector<std::string> level_to_string;
153 static std::map<std::string, LogLevel> string_to_level;
157 static void Initialize();
161 static void AddLevel(
LogLevel level, std::string text);
164 static int spc_per_lev_;
170 static int field_width_;
static LogLevel & ReportLevel()
Use to get/set the (global) log level report cutoff.
static LogLevel ToLogLevel(std::string text)
Converts a string into a corresponding LogLevel value.
static void SetNoMem(bool nm)
Sets whether or not agent/agent log entries should be printed.
static void SetReportLevel(LogLevel level)
Sets the report level.
std::ostringstream & Get(LogLevel level, std::string prefix)
Returns a string stream by reference that is flushed to stdout by the Logger class destructor.
static void SetNoAgent(bool na)
Sets whether or not agent/agent log entries should be printed.
static std::string ToString(LogLevel level)
Converts a LogLevel enum value into a corrsponding string.
static bool & NoMem()
Set whether or not agent/agent log entries should be printed.
static bool & NoAgent()
Set whether or not agent/agent log entries should be printed.
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
LogLevel
categorical (verbosity) levels for log statements.
@ LEV_DEBUG3
debugging information
@ LEV_DEBUG5
debugging information - most verbose
@ LEV_DEBUG4
debugging information
@ LEV_INFO3
Information helpful for simulation users and developers alike.
@ LEV_DEBUG1
debugging information - least verbose
@ LEV_INFO4
Information helpful for simulation users and developers alike.
@ LEV_WARN
Use to report questionable simulation state (use extremely sparingly)
@ LEV_INFO2
Information helpful for simulation users and developers alike.
@ LEV_INFO5
Information helpful for simulation users and developers alike.
@ LEV_INFO1
Information helpful for simulation users and developers alike.
@ LEV_DEBUG2
debugging information
@ LEV_ERROR
Use for errors that require agent code or input file modification (use extremely sparingly)