201 #define NS_LOG_COMPONENT_DEFINE(name) \
202 static ns3::LogComponent g_log = ns3::LogComponent (name, __FILE__)
212 #define NS_LOG_COMPONENT_DEFINE_MASK(name, mask) \
213 static ns3::LogComponent g_log = ns3::LogComponent (name, __FILE__, mask)
220 #define NS_LOG_ERROR(msg) \
221 NS_LOG (ns3::LOG_ERROR, msg)
228 #define NS_LOG_WARN(msg) \
229 NS_LOG (ns3::LOG_WARN, msg)
236 #define NS_LOG_DEBUG(msg) \
237 NS_LOG (ns3::LOG_DEBUG, msg)
244 #define NS_LOG_INFO(msg) \
245 NS_LOG (ns3::LOG_INFO, msg)
252 #define NS_LOG_LOGIC(msg) \
253 NS_LOG (ns3::LOG_LOGIC, msg)
323 const std::string & file,
355 char const *
Name (
void)
const;
360 std::string
File (
void)
const;
445 m_os <<
", " << param;
LogComponent(const std::string &name, const std::string &file, const enum LogLevel mask=LOG_NONE)
Constructor.
void LogComponentDisable(char const *name, enum LogLevel level)
Disable the logging output associated with that log component.
std::ostream & m_os
Underlying output stream.
ParameterLogger & operator<<(T param)
Write a function parameter on the output stream, separating parameters after the first by ...
bool m_first
First argument flag, doesn't get ,.
A single log component configuration.
ParameterLogger(std::ostream &os)
Constructor.
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.
Rare ad-hoc debug messages.
Control flow tracing within functions.
Insert , when streaming function arguments.
Serious error messages only.
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.
bool IsEnabled(const enum LogLevel level) const
Check if this LogComponent is enabled for 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.
void LogComponentPrintList(void)
Print the list of logging messages available.
LogNodePrinter LogGetNodePrinter(void)
Get the LogNodePrinter function currently in use.
std::map< std::string, LogComponent * > ComponentList
LogComponent name map.
void LogComponentEnableAll(enum LogLevel level)
Enable the logging output for all registered log components.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Prefix all trace prints with simulation time.
void LogComponentDisableAll(enum LogLevel level)
Disable all logging for all components.
Prefix all trace prints with function.
static ComponentList * GetComponentList(void)
Get the list of LogComponnents.
int32_t m_mask
Blocked LogLevels.
int32_t m_levels
Enabled LogLevels.
void LogSetTimePrinter(LogTimePrinter printer)
Set the LogTimePrinter function to be used to prepend log messages with the simulation time...
std::string File(void) const
Get the compilation unit defining this LogComponent.
Prefix all trace prints with simulation node.
bool IsNoneEnabled(void) const
Check if all levels are disabled.
LogLevel
Logging severity classes and levels.
Informational messages (e.g., banners).
char const * Name(void) const
Get the name of this LogComponent.
Prefix all trace prints with log level (severity).
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.