A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
log.cc File Reference

ns3::LogComponent and related implementations. More...

#include "log.h"
#include "assert.h"
#include "environment-variable.h"
#include "fatal-error.h"
#include "string.h"
#include "ns3/core-config.h"
#include <algorithm>
#include <cstring>
#include <iostream>
#include <list>
#include <locale>
#include <map>
#include <numeric>
#include <stdexcept>
#include <utility>
+ Include dependency graph for log.cc:

Go to the source code of this file.

Classes

class  ns3::PrintList
 Handler for the undocumented print-list token in NS_LOG which triggers printing of the list of log components, then exits. More...
 

Namespaces

namespace  anonymous_namespace{log.cc}
 Unnamed namespace for log.cc.
 
namespace  ns3
 Every class exported by the ns3 library is enclosed in the ns3 namespace.
 

Functions

static void ns3::CheckEnvironmentVariables ()
 Parse the NS_LOG environment variable.
 
static bool ns3::ComponentExists (std::string componentName)
 Check if a log component exists.
 
LogComponent & ns3::GetLogComponent (const std::string name)
 Get the LogComponent registered with the given name.
 
void ns3::LogComponentDisable (const std::string &name, LogLevel level)
 Disable the logging output associated with that log component.
 
void ns3::LogComponentDisableAll (LogLevel level)
 Disable all logging for all components.
 
void ns3::LogComponentEnable (const std::string &name, LogLevel level)
 Enable the logging output associated with that log component.
 
void ns3::LogComponentEnableAll (LogLevel level)
 Enable the logging output for all registered log components.
 
void ns3::LogComponentPrintList ()
 Print the list of logging messages available.
 
NodePrinter ns3::LogGetNodePrinter ()
 Get the LogNodePrinter function currently in use.
 
TimePrinter ns3::LogGetTimePrinter ()
 Get the LogTimePrinter function currently in use.
 
void ns3::LogSetNodePrinter (NodePrinter np)
 Set the LogNodePrinter function to be used to prepend log messages with the node id.
 
void ns3::LogSetTimePrinter (TimePrinter lp)
 Set the TimePrinter function to be used to prepend log messages with the simulation time.
 
template<>
ParameterLogger & ns3::ParameterLogger::operator<<< std::string > (const std::string &param)
 Specialization for strings.
 

Variables

static NodePrinter ns3::g_logNodePrinter = nullptr
 The Log NodePrinter.
 
static TimePrinter ns3::g_logTimePrinter = nullptr
 The Log TimePrinter.
 
static PrintList ns3::g_printList
 Invoke handler for print-list in NS_LOG environment variable.
 
const std::map< std::string, ns3::LogLevelanonymous_namespace{log.cc}::LOG_LABEL_LEVELS
 Mapping of log level text names to values.
 
const std::map< ns3::LogLevel, std::string > anonymous_namespace{log.cc}::LOG_LEVEL_LABELS
 Inverse mapping of level values to log level text names.
 

Detailed Description

ns3::LogComponent and related implementations.

Definition in file log.cc.