8std::vector<std::string> Logger::level_to_string;
9std::map<std::string, LogLevel> Logger::string_to_level;
11bool Logger::no_agent =
false;
12bool Logger::no_mem =
false;
14int Logger::spc_per_lev_ = 2;
15int Logger::field_width_ = 6;
27 prefix = prefix + std::string(
prefix_len - prefix.length(),
' ');
29 os <<
ToString(level) <<
"(" << prefix <<
"):";
30 os << std::string(
ind_level * spc_per_lev_,
' ');
43void Logger::Initialize() {
45 Logger::AddLevel(
LEV_WARN,
"LEV_WARN");
60 if (string_to_level.count(
text) > 0) {
61 return string_to_level[
text];
71 text = level_to_string.at((
int)level);
81 Logger::string_to_level[
text] = level;
83 text = std::string(field_width_ -
text.size(),
' ') +
text;
84 Logger::level_to_string.push_back(
text);
static LogLevel ToLogLevel(std::string text)
Converts a string into a corresponding LogLevel value.
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 std::string ToString(LogLevel level)
Converts a LogLevel enum value into a corrsponding string.
Code providing rudimentary logging capability for the Cyclus core.
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