202 #define NS_LOG_COMPONENT_DEFINE(name) \ 203 static ns3::LogComponent g_log = ns3::LogComponent (name, __FILE__) 213 #define NS_LOG_COMPONENT_DEFINE_MASK(name, mask) \ 214 static ns3::LogComponent g_log = ns3::LogComponent (name, __FILE__, mask) 225 #define NS_LOG_TEMPLATE_DECLARE LogComponent & g_log 236 #define NS_LOG_TEMPLATE_DEFINE(name) g_log (GetLogComponent (name)) 246 #define NS_LOG_STATIC_TEMPLATE_DEFINE(name) \ 247 static LogComponent & NS_UNUSED_GLOBAL (g_log) = GetLogComponent (name) 254 #define NS_LOG_ERROR(msg) \ 255 NS_LOG (ns3::LOG_ERROR, msg) 262 #define NS_LOG_WARN(msg) \ 263 NS_LOG (ns3::LOG_WARN, msg) 270 #define NS_LOG_DEBUG(msg) \ 271 NS_LOG (ns3::LOG_DEBUG, msg) 278 #define NS_LOG_INFO(msg) \ 279 NS_LOG (ns3::LOG_INFO, msg) 286 #define NS_LOG_LOGIC(msg) \ 287 NS_LOG (ns3::LOG_LOGIC, msg) 357 const std::string &
file,
389 char const *
Name (
void)
const;
394 std::string
File (
void)
const;
501 m_os <<
", " << param;
508 ParameterLogger::operator<< (std::vector<T> vector)
510 for (
auto i : vector)
524 ParameterLogger::operator<< <std::string>(
const std::string param);
533 ParameterLogger::operator<< <const char *>(
const char * param);
542 ParameterLogger::operator<< <int8_t>(int8_t param);
551 ParameterLogger::operator<< <uint8_t>(uint8_t param);
std::string File(void) const
Get the compilation unit defining this LogComponent.
LogComponent(const std::string &name, const std::string &file, const enum LogLevel mask=LOG_NONE)
Constructor.
Serious error messages only.
Prefix all trace prints with simulation node.
ParameterLogger & operator<<(T param)
Write a function parameter on the output stream, separating parameters after the first by ...
void LogComponentDisable(char const *name, enum LogLevel level)
Disable the logging output associated with that log component.
std::ostream & m_os
Underlying output stream.
bool IsNoneEnabled(void) const
Check if all levels are disabled.
Informational messages (e.g., banners).
bool m_first
First argument flag, doesn't get ,.
A single log component configuration.
ParameterLogger(std::ostream &os)
Constructor.
char const * Name(void) const
Get the name of this LogComponent.
void Disable(const enum LogLevel level)
Disable logging at level for this LogComponent.
void(* LogTimePrinter)(std::ostream &os)
Function signature for prepending the simulation time to a log message.
void EnvVarCheck(void)
Parse the NS_LOG environment variable for options relating to this LogComponent.
void(* LogNodePrinter)(std::ostream &os)
Function signature for prepending the node id to a log message.
std::string m_file
File defining this LogComponent.
Insert , when streaming function arguments.
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.
void Enable(const enum LogLevel level)
Enable this LogComponent at level.
void LogSetNodePrinter(LogNodePrinter printer)
Set the LogNodePrinter function to be used to prepend log messages with the node id.
void SetMask(const enum LogLevel level)
Prevent the enabling of a specific LogLevel.
Prefix all trace prints with log level (severity).
void LogComponentPrintList(void)
Print the list of logging messages available.
Control flow tracing within functions.
LogNodePrinter LogGetNodePrinter(void)
Get the LogNodePrinter function currently in use.
Definition of empty logging macros and the NS_LOG_NOOP_INTERNAL macro.
std::map< std::string, LogComponent * > ComponentList
LogComponent name map.
void LogComponentEnableAll(enum LogLevel level)
Enable the logging output for all registered log components.
Prefix all trace prints with simulation time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void LogComponentDisableAll(enum LogLevel level)
Disable all logging for all components.
static ComponentList * GetComponentList(void)
Get the list of LogComponnents.
NS_LOG and related logging macro definitions.
int32_t m_mask
Blocked LogLevels.
int32_t m_levels
Enabled LogLevels.
LogComponent & GetLogComponent(const std::string name)
Get the LogComponent registered with the given name.
LogLevel
Logging severity classes and levels.
void LogSetTimePrinter(LogTimePrinter printer)
Set the LogTimePrinter function to be used to prepend log messages with the simulation time...
Prefix all trace prints with function.
Rare ad-hoc debug messages.
bool IsEnabled(const enum LogLevel level) const
Check if this LogComponent is enabled for level.
static std::string GetLevelLabel(const enum LogLevel level)
Get the string label for the given LogLevel.
LogTimePrinter LogGetTimePrinter(void)
Get the LogTimePrinter function currently in use.
std::string m_name
LogComponent name.