9#ifndef CYCLUS_SRC_LOGGER_H_
10#define CYCLUS_SRC_LOGGER_H_
35#define LOG(level, prefix) \
36 if ((level > cyclus::Logger::ReportLevel()) | cyclus::Logger::NoAgent()) ; \
37 else cyclus::Logger().Get(level, prefix)
40 if (level > cyclus::Logger::ReportLevel()) ; \
41 else cyclus::Logger().Get(level, "core")
44 if ((level > cyclus::Logger::ReportLevel()) | cyclus::Logger::NoMem()) ; \
45 else cyclus::Logger().Get(level, "memory")
77 std::ostringstream&
Get(
LogLevel level, std::string prefix);
131 std::ostringstream
os;
143 static bool no_agent;
149 static std::vector<std::string> level_to_string;
152 static std::map<std::string, LogLevel> string_to_level;
156 static void Initialize();
163 static int spc_per_lev_;
169 static int field_width_;
A logging tool providing finer grained control over standard output for debugging and other purposes.
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 - most verbose.
@ LEV_INFO1
Information helpful for simulation users and developers alike - least verbose.
@ LEV_DEBUG2
debugging information
@ LEV_ERROR
Use for errors that require agent code or input file modification (use extremely sparingly)
T OptionalQuery(InfileTree *tree, std::string query, T default_val)
a query method for optional parameters