|
|
| 51 |
LOG_LEVEL_ALL = LOG_ALL, |
51 |
LOG_LEVEL_ALL = LOG_ALL, |
| 52 |
|
52 |
|
| 53 |
LOG_PREFIX_FUNC = 0x80000000, // prefix all trace prints with function |
53 |
LOG_PREFIX_FUNC = 0x80000000, // prefix all trace prints with function |
| 54 |
LOG_PREFIX_TIME = 0x40000000 // prefix all trace prints with simulation time |
54 |
LOG_PREFIX_TIME = 0x40000000, // prefix all trace prints with simulation time |
|
|
55 |
LOG_PREFIX_TIME_S = 0x20000000 // prefix all trace prints with simulation time (seconds) |
| 55 |
}; |
56 |
}; |
| 56 |
|
57 |
|
| 57 |
/** |
58 |
/** |
|
|
| 149 |
static ns3::LogComponent g_log = ns3::LogComponent (name) |
150 |
static ns3::LogComponent g_log = ns3::LogComponent (name) |
| 150 |
|
151 |
|
| 151 |
#define NS_LOG_APPEND_TIME_PREFIX \ |
152 |
#define NS_LOG_APPEND_TIME_PREFIX \ |
| 152 |
if (g_log.IsEnabled (ns3::LOG_PREFIX_TIME)) \ |
153 |
if (g_log.IsEnabled (ns3::LOG_PREFIX_TIME) || \ |
|
|
154 |
g_log.IsEnabled (ns3::LOG_PREFIX_TIME_S)) \ |
| 153 |
{ \ |
155 |
{ \ |
| 154 |
ns3::LogTimePrinter printer = ns3::LogGetTimePrinter (); \ |
156 |
ns3::LogTimePrinter printer = ns3::LogGetTimePrinter (); \ |
| 155 |
if (printer != 0) \ |
157 |
if (printer != 0) \ |
| 156 |
{ \ |
158 |
{ \ |
| 157 |
(*printer) (std::clog); \ |
159 |
if (g_log.IsEnabled (ns3::LOG_PREFIX_TIME_S)) \ |
|
|
160 |
{ \ |
| 161 |
(*printer) (std::clog, true); \ |
| 162 |
} \ |
| 163 |
else if (g_log.IsEnabled (ns3::LOG_PREFIX_TIME)) \ |
| 164 |
{ \ |
| 165 |
(*printer) (std::clog, false); \ |
| 166 |
} \ |
| 158 |
std::clog << " "; \ |
167 |
std::clog << " "; \ |
| 159 |
} \ |
168 |
} \ |
| 160 |
} |
169 |
} |
|
|
| 319 |
*/ |
328 |
*/ |
| 320 |
void LogComponentPrintList (void); |
329 |
void LogComponentPrintList (void); |
| 321 |
|
330 |
|
| 322 |
typedef void (*LogTimePrinter) (std::ostream &os); |
331 |
typedef void (*LogTimePrinter) (std::ostream &os, bool printSeconds); |
| 323 |
|
332 |
|
| 324 |
void LogSetTimePrinter (LogTimePrinter); |
333 |
void LogSetTimePrinter (LogTimePrinter); |
| 325 |
LogTimePrinter LogGetTimePrinter(void); |
334 |
LogTimePrinter LogGetTimePrinter(void); |