204 #define NS_LOG_COMPONENT_DEFINE(name) \ 205 static ns3::LogComponent g_log = ns3::LogComponent (name, __FILE__) 215 #define NS_LOG_COMPONENT_DEFINE_MASK(name, mask) \ 216 static ns3::LogComponent g_log = ns3::LogComponent (name, __FILE__, mask) 227 #define NS_LOG_TEMPLATE_DECLARE LogComponent & g_log 238 #define NS_LOG_TEMPLATE_DEFINE(name) g_log (GetLogComponent (name)) 248 #define NS_LOG_STATIC_TEMPLATE_DEFINE(name) \ 249 static LogComponent & NS_UNUSED_GLOBAL (g_log) = GetLogComponent (name) 256 #define NS_LOG_ERROR(msg) \ 257 NS_LOG (ns3::LOG_ERROR, msg) 264 #define NS_LOG_WARN(msg) \ 265 NS_LOG (ns3::LOG_WARN, msg) 272 #define NS_LOG_DEBUG(msg) \ 273 NS_LOG (ns3::LOG_DEBUG, msg) 280 #define NS_LOG_INFO(msg) \ 281 NS_LOG (ns3::LOG_INFO, msg) 288 #define NS_LOG_LOGIC(msg) \ 289 NS_LOG (ns3::LOG_LOGIC, msg) 348 const std::string &
file,
380 char const *
Name (
void)
const;
385 std::string
File (
void)
const;
492 m_os <<
", " << param;
499 ParameterLogger::operator<< (std::vector<T> vector)
501 for (
auto i : vector)
515 ParameterLogger::operator<< <std::string>(
const std::string param);
524 ParameterLogger::operator<< <const char *>(
const char * param);
533 ParameterLogger::operator<< <int8_t>(int8_t param);
542 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).
void LogSetTimePrinter(TimePrinter printer)
Set the TimePrinter function to be used to prepend log messages with the simulation time...
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 EnvVarCheck(void)
Parse the NS_LOG environment variable for options relating to this LogComponent.
std::string m_file
File defining this LogComponent.
TimePrinter LogGetTimePrinter(void)
Get the LogTimePrinter function currently in use.
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(NodePrinter 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.
void(* TimePrinter)(std::ostream &os)
Function signature for features requiring a time formatter, such as logging or ShowProgress.
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.
NodePrinter LogGetNodePrinter(void)
Get the LogNodePrinter function currently in use.
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.
void(* NodePrinter)(std::ostream &os)
Function signature for prepending the node id to a log message.
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.
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.
Declaration of ns3::TimePrinter function pointer type and ns3::DefaultTimePrinter function...
Declaration of ns3::NodePrinter function pointer type and ns3::DefaultNodePrinter function...
static std::string GetLevelLabel(const enum LogLevel level)
Get the string label for the given LogLevel.
std::string m_name
LogComponent name.