DDraceNetwork Docs
log.cpp File Reference
#include "logger.h"
#include "color.h"
#include "system.h"
#include <atomic>
#include <cstdio>
#include <memory>
#include <unistd.h>
Include dependency graph for log.cpp:

Classes

class  CLoggerCollection
 
class  CLoggerAsync
 
class  CLoggerNoOp
 

Functions

void log_set_global_logger (ILogger *logger)
 
void log_global_logger_finish ()
 
void log_set_global_logger_default ()
 
ILoggerlog_get_scope_logger ()
 
void log_set_scope_logger (ILogger *logger)
 
void log_log_impl (LEVEL level, bool have_color, LOG_COLOR color, const char *sys, const char *fmt, va_list args)
 
void log_log_v (LEVEL level, const char *sys, const char *fmt, va_list args)
 
void log_log (LEVEL level, const char *sys, const char *fmt,...)
 
void log_log_color_v (LEVEL level, LOG_COLOR color, const char *sys, const char *fmt, va_list args)
 
void log_log_color (LEVEL level, LOG_COLOR color, const char *sys, const char *fmt,...)
 
std::unique_ptr< ILoggerlog_logger_android ()
 
std::unique_ptr< ILoggerlog_logger_collection (std::vector< std::shared_ptr< ILogger > > &&vpLoggers)
 
std::unique_ptr< ILoggerlog_logger_file (IOHANDLE logfile)
 
std::unique_ptr< ILoggerlog_logger_stdout ()
 
std::unique_ptr< ILoggerlog_logger_windows_debugger ()
 
std::unique_ptr< ILoggerlog_logger_noop ()
 

Variables

std::atomic< ILogger * > global_logger = nullptr
 
thread_local ILoggerscope_logger = nullptr
 
thread_local bool in_logger = false
 

Function Documentation

◆ log_log_impl()

void log_log_impl ( LEVEL  level,
bool  have_color,
LOG_COLOR  color,
const char *  sys,
const char *  fmt,
va_list  args 
)

Variable Documentation

◆ global_logger

std::atomic<ILogger *> global_logger = nullptr

◆ in_logger

thread_local bool in_logger = false

◆ scope_logger

thread_local ILogger* scope_logger = nullptr