38#define LOGLEVEL_TO_MASKLEVEL(x) (1 << x)
72 const std::string &time,
const std::string &thread_name,
73 std::string_view payload_text);
88 const std::string &time,
const std::string &thread_name,
89 std::string_view payload_text) = 0;
95 const std::string &time,
const std::string &thread_name,
96 std::string_view payload_text)
115 void setFile(
const std::string &filename, s64 file_size_max);
159 m_entries.emplace_back(
LogEntry{lev,
"",
"", std::string(line), std::string(line)});
163 const std::string &time,
const std::string &thread_name,
164 std::string_view payload_text)
override
167 m_entries.emplace_back(
LogEntry{lev, time, thread_name, std::string(payload_text), combined});
173 std::vector<LogEntry> entries;
Definition log_internal.h:135
void setLogLevel(LogLevel level)
Definition log_internal.h:150
std::vector< LogEntry > m_entries
Definition log_internal.h:185
std::vector< LogEntry > take()
Definition log_internal.h:171
DISABLE_CLASS_COPY(CaptureLogOutput)
void logRaw(LogLevel lev, std::string_view line) override
Definition log_internal.h:156
~CaptureLogOutput()
Definition log_internal.h:145
void log(LogLevel lev, const std::string &combined, const std::string &time, const std::string &thread_name, std::string_view payload_text) override
Definition log_internal.h:162
Logger & m_logger
Definition log_internal.h:180
CaptureLogOutput()=delete
CaptureLogOutput(Logger &logger)
Definition log_internal.h:140
std::mutex m_mutex
Definition log_internal.h:184
Definition log_internal.h:113
void setFile(const std::string &filename, s64 file_size_max)
Definition log.cpp:284
void logRaw(LogLevel lev, std::string_view line)
Definition log_internal.h:117
std::ofstream m_stream
Definition log_internal.h:123
Definition log_internal.h:92
void log(LogLevel lev, const std::string &combined, const std::string &time, const std::string &thread_name, std::string_view payload_text)
Definition log_internal.h:94
Definition log_internal.h:84
virtual void log(LogLevel, const std::string &combined, const std::string &time, const std::string &thread_name, std::string_view payload_text)=0
virtual void logRaw(LogLevel, std::string_view line)=0
Definition log_internal.h:40
void addOutputMasked(ILogOutput *out, LogLevelMask mask)
Definition log.cpp:149
static LogColor color_mode
Definition log_internal.h:67
std::mutex m_mutex
Definition log_internal.h:81
void logToOutputs(LogLevel, const std::string &combined, const std::string &time, const std::string &thread_name, std::string_view payload_text)
Definition log.cpp:271
void registerThread(std::string_view name)
Definition log.cpp:190
std::vector< ILogOutput * > m_outputs[LL_MAX]
Definition log_internal.h:77
void deregisterThread()
Definition log.cpp:197
void log(LogLevel lev, std::string_view text)
Definition log.cpp:240
void logRaw(LogLevel lev, std::string_view text)
Definition log.cpp:256
const std::string & getThreadName()
Definition log.cpp:223
bool isLevelSilenced(LogLevel level)
Definition log_internal.h:63
void logToOutputsRaw(LogLevel, std::string_view line)
Definition log.cpp:264
void setLevelSilenced(LogLevel lev, bool silenced)
Definition log.cpp:185
static const char * getLevelLabel(LogLevel lev)
Definition log.cpp:204
LogLevelMask removeOutput(ILogOutput *out)
Definition log.cpp:170
void addOutput(ILogOutput *out)
Definition log.cpp:139
std::atomic< bool > m_silenced_levels[LL_MAX]
Definition log_internal.h:79
std::map< std::thread::id, std::string > m_thread_names
Definition log_internal.h:80
static LogLevel stringToLevel(std::string_view name)
Definition log.cpp:119
std::atomic< bool > m_has_outputs[LL_MAX]
Definition log_internal.h:78
bool hasOutput(LogLevel level)
Definition log_internal.h:59
void addOutputMaxLevel(ILogOutput *out, LogLevel lev)
Definition log.cpp:160
Definition log_internal.h:102
StreamLogOutput(std::ostream &stream)
Definition log.cpp:311
void logRaw(LogLevel lev, std::string_view line)
Definition log.cpp:322
bool is_tty
Definition log_internal.h:110
std::ostream & m_stream
Definition log_internal.h:109
StreamLogOutput stderr_output
StreamLogOutput stdout_output
Logger g_logger
Definition log.cpp:60
LogColor
Definition log_internal.h:31
@ LOG_COLOR_NEVER
Definition log_internal.h:32
@ LOG_COLOR_AUTO
Definition log_internal.h:34
@ LOG_COLOR_ALWAYS
Definition log_internal.h:33
LogLevel
Definition log_internal.h:20
@ LL_INFO
Definition log_internal.h:25
@ LL_ERROR
Definition log_internal.h:22
@ LL_NONE
Definition log_internal.h:21
@ LL_WARNING
Definition log_internal.h:23
@ LL_TRACE
Definition log_internal.h:27
@ LL_ACTION
Definition log_internal.h:24
@ LL_MAX
Definition log_internal.h:28
@ LL_VERBOSE
Definition log_internal.h:26
u8 LogLevelMask
Definition log_internal.h:37
std::lock_guard< std::mutex > MutexAutoLock
Definition mutex_auto_lock.h:31
Definition log_internal.h:126
LogLevel level
Definition log_internal.h:127
std::string timestamp
Definition log_internal.h:128
std::string thread_name
Definition log_internal.h:129
std::string combined
Definition log_internal.h:132
std::string text
Definition log_internal.h:130