A Discrete-Event Network Simulator
API
anonymous_namespace{log.cc} Namespace Reference

Unnamed namespace for log.cc. More...

Variables

const std::map< std::string, ns3::LogLevelLOG_LABEL_LEVELS
 Mapping of log level text names to values. More...
 
const std::map< ns3::LogLevel, std::string > LOG_LEVEL_LABELS
 Inverse mapping of level values to log level text names. More...
 

Detailed Description

Unnamed namespace for log.cc.

Variable Documentation

◆ LOG_LABEL_LEVELS

const std::map<std::string, ns3::LogLevel> anonymous_namespace{log.cc}::LOG_LABEL_LEVELS
Initial value:
= {
{"none", ns3::LOG_NONE},
{"error", ns3::LOG_ERROR},
{"level_error", ns3::LOG_LEVEL_ERROR},
{"warn", ns3::LOG_WARN},
{"level_warn", ns3::LOG_LEVEL_WARN},
{"debug", ns3::LOG_DEBUG},
{"level_debug", ns3::LOG_LEVEL_DEBUG},
{"info", ns3::LOG_INFO},
{"level_info", ns3::LOG_LEVEL_INFO},
{"function", ns3::LOG_FUNCTION},
{"level_function", ns3::LOG_LEVEL_FUNCTION},
{"logic", ns3::LOG_LOGIC},
{"level_logic", ns3::LOG_LEVEL_LOGIC},
{"all", ns3::LOG_ALL},
{"level_all", ns3::LOG_LEVEL_ALL},
{"prefix_func", ns3::LOG_PREFIX_FUNC},
{"prefix_time", ns3::LOG_PREFIX_TIME},
{"prefix_node", ns3::LOG_PREFIX_NODE},
{"prefix_level", ns3::LOG_PREFIX_LEVEL},
{"prefix_all", ns3::LOG_PREFIX_ALL}
}
@ LOG_LEVEL_ALL
Print everything.
Definition: log.h:116
@ LOG_PREFIX_FUNC
Prefix all trace prints with function.
Definition: log.h:118
@ LOG_LEVEL_LOGIC
LOG_LOGIC and above.
Definition: log.h:110
@ LOG_NONE
No logging.
Definition: log.h:95
@ LOG_PREFIX_TIME
Prefix all trace prints with simulation time.
Definition: log.h:119
@ LOG_FUNCTION
Function tracing for non-trivial function calls.
Definition: log.h:106
@ LOG_ERROR
Serious error messages only.
Definition: log.h:97
@ LOG_WARN
Warning messages.
Definition: log.h:100
@ LOG_INFO
Something happened to change state.
Definition: log.h:103
@ LOG_PREFIX_ALL
All prefixes.
Definition: log.h:122
@ LOG_LEVEL_FUNCTION
LOG_FUNCTION and above.
Definition: log.h:107
@ LOG_LEVEL_ERROR
LOG_ERROR and above.
Definition: log.h:98
@ LOG_ALL
Print everything.
Definition: log.h:115
@ LOG_LEVEL_WARN
LOG_WARN and above.
Definition: log.h:101
@ LOG_LEVEL_DEBUG
LOG_DEBUG and above.
Definition: log.h:113
@ LOG_PREFIX_LEVEL
Prefix all trace prints with log level (severity).
Definition: log.h:121
@ LOG_LOGIC
Debugging logs for key branches and decisions in a function.
Definition: log.h:109
@ LOG_PREFIX_NODE
Prefix all trace prints with simulation node.
Definition: log.h:120
@ LOG_LEVEL_INFO
LOG_INFO and above.
Definition: log.h:104
@ LOG_DEBUG
Full voluminous logging to support debugging.
Definition: log.h:112

Mapping of log level text names to values.

Definition at line 51 of file log.cc.

Referenced by ns3::CheckEnvironmentVariables(), and ns3::LogComponent::EnvVarCheck().

◆ LOG_LEVEL_LABELS

const std::map<ns3::LogLevel, std::string> anonymous_namespace{log.cc}::LOG_LEVEL_LABELS
Initial value:
= {[]() {
std::map<ns3::LogLevel, std::string> labels;
for (const auto& [label, lev] : LOG_LABEL_LEVELS)
{
if (labels.find(lev) == labels.end())
{
std::string pad{label};
if (pad.size() < 5)
{
pad.insert(pad.size(), 5 - pad.size(), ' ');
}
std::transform(pad.begin(), pad.end(), pad.begin(), ::toupper);
labels[lev] = pad;
}
}
return labels;
}()}
const std::map< std::string, ns3::LogLevel > LOG_LABEL_LEVELS
Mapping of log level text names to values.
Definition: log.cc:51

Inverse mapping of level values to log level text names.

Definition at line 81 of file log.cc.

Referenced by ns3::LogComponent::GetLevelLabel().