#include <log_internal.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 (std::string_view name) |
void | deregisterThread () |
void | log (LogLevel lev, std::string_view text) |
void | logRaw (LogLevel lev, std::string_view text) |
bool | hasOutput (LogLevel level) |
bool | isLevelSilenced (LogLevel level) |
Static Public Member Functions | |
static LogLevel | stringToLevel (std::string_view name) |
static const char * | getLevelLabel (LogLevel lev) |
Static Public Attributes | |
static LogColor | color_mode = LOG_COLOR_AUTO |
Private Member Functions | |
void | logToOutputsRaw (LogLevel, std::string_view line) |
void | logToOutputs (LogLevel, const std::string &combined, const std::string &time, const std::string &thread_name, std::string_view payload_text) |
const std::string & | getThreadName () |
Private Attributes | |
std::vector< ILogOutput * > | m_outputs [LL_MAX] |
std::atomic< bool > | m_has_outputs [LL_MAX] |
std::atomic< bool > | m_silenced_levels [LL_MAX] |
std::map< std::thread::id, std::string > | m_thread_names |
std::mutex | m_mutex |
void Logger::addOutput | ( | ILogOutput * | out | ) |
References addOutputMaxLevel(), and LL_MAX.
Referenced by CaptureLogOutput::CaptureLogOutput(), and setup_log_params().
void Logger::addOutput | ( | ILogOutput * | out, |
LogLevel | lev ) |
void Logger::addOutputMasked | ( | ILogOutput * | out, |
LogLevelMask | mask ) |
References LL_MAX, LOGLEVEL_TO_MASKLEVEL, m_has_outputs, m_mutex, and m_outputs.
Referenced by addOutput().
void Logger::addOutputMaxLevel | ( | ILogOutput * | out, |
LogLevel | lev ) |
References LL_MAX, m_has_outputs, m_mutex, and m_outputs.
Referenced by addOutput(), init_log_streams(), main(), CaptureLogOutput::setLogLevel(), and setup_log_params().
void Logger::deregisterThread | ( | ) |
References m_mutex, and m_thread_names.
Referenced by Thread::threadProc().
|
static |
|
private |
|
inline |
References m_has_outputs.
Referenced by LevelTarget::hasOutput().
|
inline |
References m_silenced_levels.
Referenced by log(), and logRaw().
void Logger::log | ( | LogLevel | lev, |
std::string_view | text ) |
References getLevelLabel(), getThreadName(), getTimestamp(), isLevelSilenced(), and logToOutputs().
Referenced by ModApiUtil::l_log(), LevelTarget::log(), logToOutputs(), and MyEventReceiver::OnEvent().
void Logger::logRaw | ( | LogLevel | lev, |
std::string_view | text ) |
References isLevelSilenced(), and logToOutputsRaw().
Referenced by LevelTarget::log(), and logToOutputsRaw().
|
private |
|
private |
void Logger::registerThread | ( | std::string_view | 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, m_has_outputs, m_mutex, and m_outputs.
Referenced by CaptureLogOutput::~CaptureLogOutput(), init_log_streams(), CaptureLogOutput::setLogLevel(), and setup_log_params().
void Logger::setLevelSilenced | ( | LogLevel | lev, |
bool | silenced ) |
References m_silenced_levels.
Referenced by run_tests(), and run_tests().
|
static |
References LL_ACTION, LL_ERROR, LL_INFO, LL_MAX, LL_NONE, LL_TRACE, LL_VERBOSE, and LL_WARNING.
Referenced by init_log_streams(), ModApiUtil::l_log(), and Game::readSettings().
|
static |
Referenced by StreamLogOutput::logRaw(), and setup_log_params().
|
private |
Referenced by addOutputMasked(), addOutputMaxLevel(), hasOutput(), and removeOutput().
|
mutableprivate |
Referenced by addOutputMasked(), addOutputMaxLevel(), deregisterThread(), logToOutputs(), logToOutputsRaw(), registerThread(), and removeOutput().
|
private |
Referenced by addOutputMasked(), addOutputMaxLevel(), logToOutputs(), logToOutputsRaw(), and removeOutput().
|
private |
Referenced by isLevelSilenced(), and setLevelSilenced().
|
private |
Referenced by deregisterThread(), getThreadName(), and registerThread().