ngscopeclient v0.2.2
Loading...
Searching...
No Matches
Functions | Variables
log.cpp File Reference

Implementation of base LogSink class and some global helper functions. More...

#include "log.h"
#include <cstdarg>
#include <cstdlib>
#include <string>
Include dependency graph for log.cpp:

Functions

bool ParseLoggerArguments (int &i, int argc, char *argv[], Severity &console_verbosity)
 Helper function for parsing arguments that use common syntax.
 
void LogFatal (const char *format,...)
 
void LogError (const char *format,...)
 
void LogWarning (const char *format,...)
 
void LogNotice (const char *format,...)
 
void LogVerbose (const char *format,...)
 
void LogDebug (const char *format,...)
 
void LogDebugTrace (const char *function, const char *format,...)
 
void Log (Severity severity, const char *format,...)
 
string LogHexDump (const unsigned char *data, size_t len)
 Convert a sequence of bytes to its textual representation ("hex dump").
 

Variables

mutex g_log_mutex
 Mutex for serializing access to global logging state.
 
__thread unsigned int g_logIndentLevel = 0
 The current indentation level.
 
vector< unique_ptr< LogSink > > g_log_sinks
 The set of log sink objects logtools knows about.
 
bool g_logToStdoutAlways = false
 If set, STDLogSink will only write to stdout even for error/warning severity and never use stderr.
 
set< stringg_trace_filters
 Set of classes or class::function for high verbosity trace messages.
 

Detailed Description

Implementation of base LogSink class and some global helper functions.

Function Documentation

◆ LogHexDump()

string LogHexDump ( const unsigned char data,
size_t  len 
)

Convert a sequence of bytes to its textual representation ("hex dump").

Parameters
dataPointer to the byte sequence to print.
lenNumber of bytes to print.
Returns
string representation of the data buffer.

Variable Documentation

◆ g_log_sinks

vector<unique_ptr<LogSink> > g_log_sinks

The set of log sink objects logtools knows about.

When a log message is printed, it is sent to every sink in this list for filtering and display.