A single log component configuration. More...
#include <log.h>
Public Member Functions | |
LogComponent (const std::string &name, const enum LogLevel mask=LOG_NONE) | |
Constructor. More... | |
void | Disable (const enum LogLevel level) |
Disable logging at level for this LogComponent. More... | |
void | Enable (const enum LogLevel level) |
Enable this LogComponent at level More... | |
bool | IsEnabled (const enum LogLevel level) const |
Check if this LogComponent is enabled for level More... | |
bool | IsNoneEnabled (void) const |
Check if all levels are disabled. More... | |
char const * | Name (void) const |
Get the name of this LogComponent. More... | |
void | SetMask (const enum LogLevel level) |
Prevent the enabling of a specific LogLevel. More... | |
Static Public Member Functions | |
static std::string | GetLevelLabel (const enum LogLevel level) |
Get the string label for the given LogLevel. More... | |
Private Member Functions | |
void | EnvVarCheck (void) |
Parse the NS_LOG environment variable for options relating to this LogComponent. More... | |
Private Attributes | |
int32_t | m_levels |
Enabled LogLevels. More... | |
int32_t | m_mask |
Blocked LogLevels. More... | |
std::string | m_name |
LogComponent name. More... | |
Constructor.
[in] | name | the user-visible name for this component. |
[in] | mask | LogLevels blocked for this LogComponent. Blocking a log level helps prevent recursion by logging in functions which help implement the logging facility. |
Definition at line 87 of file log.cc.
References EnvVarCheck(), ns3::GetComponentList(), and NS_FATAL_ERROR.
void ns3::LogComponent::Disable | ( | const enum LogLevel | level | ) |
Disable logging at level for this LogComponent.
[in] | level | the LogLevel to disable. |
Definition at line 270 of file log.cc.
References m_levels.
void ns3::LogComponent::Enable | ( | const enum LogLevel | level | ) |
Enable this LogComponent at level
[in] | level | the LogLevel to enable. |
Definition at line 264 of file log.cc.
References m_levels, and m_mask.
Referenced by EnvVarCheck().
|
private |
Parse the NS_LOG
environment variable for options relating to this LogComponent.
Definition at line 107 of file log.cc.
References Enable(), ns3::LOG_DEBUG, ns3::LOG_ERROR, ns3::LOG_FUNCTION, ns3::LOG_INFO, ns3::LOG_LEVEL_ALL, ns3::LOG_LEVEL_DEBUG, ns3::LOG_LEVEL_ERROR, ns3::LOG_LEVEL_FUNCTION, ns3::LOG_LEVEL_INFO, ns3::LOG_LEVEL_LOGIC, ns3::LOG_LEVEL_WARN, ns3::LOG_LOGIC, ns3::LOG_PREFIX_ALL, ns3::LOG_PREFIX_FUNC, ns3::LOG_PREFIX_LEVEL, ns3::LOG_PREFIX_NODE, ns3::LOG_PREFIX_TIME, ns3::LOG_WARN, and m_name.
Referenced by LogComponent().
|
static |
Get the string label for the given LogLevel.
[in] | level | the LogLevel to get the label for. |
Definition at line 283 of file log.cc.
References ns3::LOG_DEBUG, ns3::LOG_ERROR, ns3::LOG_FUNCTION, ns3::LOG_INFO, ns3::LOG_LOGIC, and ns3::LOG_WARN.
bool ns3::LogComponent::IsEnabled | ( | const enum LogLevel | level | ) | const |
Check if this LogComponent is enabled for level
[in] | level | the level to check for. |
Definition at line 245 of file log.cc.
References m_levels.
bool ns3::LogComponent::IsNoneEnabled | ( | void | ) | const |
char const * ns3::LogComponent::Name | ( | void | ) | const |
Get the name of this LogComponent.
Definition at line 276 of file log.cc.
References m_name.
void ns3::LogComponent::SetMask | ( | const enum LogLevel | level | ) |
|
private |
Enabled LogLevels.
Definition at line 326 of file log.h.
Referenced by Disable(), Enable(), IsEnabled(), and IsNoneEnabled().
|
private |
|
private |