Unnamed namespace for log line assembly buffers. More...
Classes | |
| struct | LogLine |
| A memory buffer and the ostream assembling a log line into it. More... | |
| class | LogLineBuf |
| A streambuf appending to a std::string whose capacity is reused between log lines, so steady-state logging does not allocate. More... | |
Functions | |
| void | EmitLine (std::string &line) |
| Write an assembled log line to std::clog, terminated by a newline, and empty it. | |
| LogLine & | GetLogLine () |
| void | WriteStdErr (const char *s, std::size_t n) |
| Write to the standard error file descriptor, bypassing std::clog. | |
Variables | |
| LogLine * | g_logLine = nullptr |
| The thread's log line, once created. | |
| bool | g_logLineDestroyed = false |
| Whether this thread's LogLine has been destroyed. | |
Unnamed namespace for log line assembly buffers.
| void ns3::anonymous_namespace{log.cc}::EmitLine | ( | std::string & | line | ) |
Write an assembled log line to std::clog, terminated by a newline, and empty it.
| [in,out] | line | The line to emit. |
Definition at line 251 of file log.cc.
References EmitLine().
Referenced by ns3::anonymous_namespace{log.cc}::LogLine::~LogLine(), and EmitLine().
| LogLine & ns3::anonymous_namespace{log.cc}::GetLogLine | ( | ) |
Definition at line 300 of file log.cc.
References g_logLine, and GetLogLine().
Referenced by GetLogLine().
| void ns3::anonymous_namespace{log.cc}::WriteStdErr | ( | const char * | s, |
| std::size_t | n ) |
Write to the standard error file descriptor, bypassing std::clog.
| [in] | s | The characters to write. |
| [in] | n | The number of characters to write. |
Definition at line 366 of file log.cc.
References WriteStdErr().
Referenced by WriteStdErr().
|
thread_local |
The thread's log line, once created.
A plain pointer, so a signal handler can reach the line being assembled without running the thread_local initialization it may have interrupted.
Definition at line 296 of file log.cc.
Referenced by GetLogLine().
|
thread_local |
Whether this thread's LogLine has been destroyed.
Trivially destructible, so it remains readable during program shutdown, after the buffer's own thread_local destructor has run. Core itself logs during static destruction (e.g. Time::Clear() from ~Time of static attribute defaults), so this must be handled.
Definition at line 267 of file log.cc.
Referenced by ns3::anonymous_namespace{log.cc}::LogLine::~LogLine().