#include <log.h>
Public Member Functions | |
void | addOutput (ILogOutput *out) |
void | addOutput (ILogOutput *out, LogLevel lev) |
void | addOutputMasked (ILogOutput *out, LogLevelMask mask) |
void | addOutputMaxLevel (ILogOutput *out, LogLevel lev) |
LogLevelMask | removeOutput (ILogOutput *out) |
void | setLevelSilenced (LogLevel lev, bool silenced) |
void | registerThread (const std::string &name) |
void | deregisterThread () |
void | log (LogLevel lev, const std::string &text) |
void | logRaw (LogLevel lev, const std::string &text) |
void | setTraceEnabled (bool enable) |
bool | getTraceEnabled () |
Static Public Member Functions | |
static LogLevel | stringToLevel (const std::string &name) |
static const std::string | getLevelLabel (LogLevel lev) |
Static Public Attributes | |
static LogColor | color_mode = LOG_COLOR_AUTO |
Private Member Functions | |
void | logToOutputsRaw (LogLevel, const std::string &line) |
void | logToOutputs (LogLevel, const std::string &combined, const std::string &time, const std::string &thread_name, const std::string &payload_text) |
const std::string | getThreadName () |
Private Attributes | |
std::vector< ILogOutput * > | m_outputs [LL_MAX] |
volatile bool | m_silenced_levels [LL_MAX] |
std::map< std::thread::id, std::string > | m_thread_names |
std::mutex | m_mutex |
bool | m_trace_enabled |
void Logger::addOutput | ( | ILogOutput * | out | ) |
References addOutputMaxLevel(), and LL_MAX.
Referenced by setup_log_params().
void Logger::addOutput | ( | ILogOutput * | out, |
LogLevel | lev | ||
) |
References m_outputs.
void Logger::addOutputMasked | ( | ILogOutput * | out, |
LogLevelMask | mask | ||
) |
References LL_MAX, LOGLEVEL_TO_MASKLEVEL, and m_outputs.
void Logger::addOutputMaxLevel | ( | ILogOutput * | out, |
LogLevel | lev | ||
) |
References LL_MAX, and m_outputs.
Referenced by addOutput(), init_log_streams(), main(), setup_log_params(), and LogOutputBuffer::updateLogLevel().
void Logger::deregisterThread | ( | ) |
References m_mutex, and m_thread_names.
Referenced by Thread::threadProc().
|
static |
References ARRLEN, LL_MAX, and STATIC_ASSERT().
Referenced by log().
|
private |
|
inline |
References m_trace_enabled.
void Logger::log | ( | LogLevel | lev, |
const std::string & | text | ||
) |
References getLevelLabel(), getThreadName(), getTimestamp(), logToOutputs(), and m_silenced_levels.
Referenced by LogBuffer::flush(), ModApiUtil::l_log(), logToOutputs(), and MyEventReceiver::OnEvent().
void Logger::logRaw | ( | LogLevel | lev, |
const std::string & | text | ||
) |
References logToOutputsRaw(), and m_silenced_levels.
Referenced by RawLogBuffer::flush(), and logToOutputsRaw().
|
private |
|
private |
void Logger::registerThread | ( | const std::string & | name | ) |
References m_mutex, and m_thread_names.
Referenced by main(), and Thread::threadProc().
LogLevelMask Logger::removeOutput | ( | ILogOutput * | out | ) |
References LL_MAX, LOGLEVEL_TO_MASKLEVEL, and m_outputs.
Referenced by LogOutputBuffer::~LogOutputBuffer(), init_log_streams(), setup_log_params(), and LogOutputBuffer::updateLogLevel().
void Logger::setLevelSilenced | ( | LogLevel | lev, |
bool | silenced | ||
) |
References m_silenced_levels.
Referenced by run_tests().
|
inline |
References m_trace_enabled.
Referenced by setup_log_params().
|
static |
References LL_ACTION, LL_ERROR, LL_INFO, LL_MAX, LL_NONE, LL_VERBOSE, and LL_WARNING.
Referenced by init_log_streams(), ModApiUtil::l_log(), and LogOutputBuffer::updateLogLevel().
|
static |
Referenced by StreamLogOutput::logRaw(), and setup_log_params().
|
mutableprivate |
Referenced by deregisterThread(), logToOutputs(), logToOutputsRaw(), and registerThread().
|
private |
Referenced by addOutput(), addOutputMasked(), addOutputMaxLevel(), logToOutputs(), logToOutputsRaw(), and removeOutput().
|
private |
Referenced by log(), logRaw(), and setLevelSilenced().
|
private |
Referenced by deregisterThread(), getThreadName(), and registerThread().
|
private |
Referenced by getTraceEnabled(), and setTraceEnabled().