42#define LOGLEVEL_TO_MASKLEVEL(x) (1 << x)
77 const std::string &time,
const std::string &thread_name,
78 std::string_view payload_text);
94 const std::string &time,
const std::string &thread_name,
95 std::string_view payload_text) = 0;
101 const std::string &time,
const std::string &thread_name,
102 std::string_view payload_text)
121 void setFile(
const std::string &filename, s64 file_size_max);
165 m_entries.emplace_back(
LogEntry{lev,
"",
"", std::string(line), std::string(line)});
169 const std::string &time,
const std::string &thread_name,
170 std::string_view payload_text)
override
173 m_entries.emplace_back(
LogEntry{lev, time, thread_name, std::string(payload_text), combined});
179 std::vector<LogEntry> entries;
Definition log_internal.h:141
void setLogLevel(LogLevel level)
Definition log_internal.h:156
std::vector< LogEntry > m_entries
Definition log_internal.h:191
std::vector< LogEntry > take()
Definition log_internal.h:177
DISABLE_CLASS_COPY(CaptureLogOutput)
void logRaw(LogLevel lev, std::string_view line) override
Definition log_internal.h:162
~CaptureLogOutput()
Definition log_internal.h:151
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:168
Logger & m_logger
Definition log_internal.h:186
CaptureLogOutput()=delete
CaptureLogOutput(Logger &logger)
Definition log_internal.h:146
std::mutex m_mutex
Definition log_internal.h:190
Definition log_internal.h:119
void setFile(const std::string &filename, s64 file_size_max)
Definition log.cpp:298
void logRaw(LogLevel lev, std::string_view line)
Definition log_internal.h:123
std::ofstream m_stream
Definition log_internal.h:129
Definition log_internal.h:98
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:100
Definition log_internal.h:90
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:44
void addOutputMasked(ILogOutput *out, LogLevelMask mask)
Definition log.cpp:145
static LogColor color_mode
Definition log_internal.h:71
std::mutex m_mutex
Definition log_internal.h:83
void logToOutputs(LogLevel, const std::string &combined, const std::string &time, const std::string &thread_name, std::string_view payload_text)
Definition log.cpp:285
void registerThread(std::string_view name)
Definition log.cpp:186
std::vector< ILogOutput * > m_outputs[LL_MAX]
Definition log_internal.h:84
void deregisterThread()
Definition log.cpp:193
void log(LogLevel lev, std::string_view text)
Definition log.cpp:252
void logRaw(LogLevel lev, std::string_view text)
Definition log.cpp:270
const std::string & getThreadName()
Definition log.cpp:219
bool isLevelSilenced(LogLevel level)
Definition log_internal.h:67
static LogTimestamp timestamp_mode
Definition log_internal.h:72
void logToOutputsRaw(LogLevel, std::string_view line)
Definition log.cpp:278
void setLevelSilenced(LogLevel lev, bool silenced)
Definition log.cpp:181
static const char * getLevelLabel(LogLevel lev)
Definition log.cpp:200
LogLevelMask removeOutput(ILogOutput *out)
Definition log.cpp:166
void addOutput(ILogOutput *out)
Definition log.cpp:135
std::atomic< bool > m_silenced_levels[LL_MAX]
Definition log_internal.h:86
std::map< std::thread::id, std::string > m_thread_names
Definition log_internal.h:87
static LogLevel stringToLevel(std::string_view name)
Definition log.cpp:115
std::atomic< bool > m_has_outputs[LL_MAX]
Definition log_internal.h:85
bool hasOutput(LogLevel level)
Definition log_internal.h:63
static std::string getLogTimestamp()
Definition log.cpp:238
void addOutputMaxLevel(ILogOutput *out, LogLevel lev)
Definition log.cpp:156
Definition log_internal.h:108
StreamLogOutput(std::ostream &stream)
Definition log.cpp:325
void logRaw(LogLevel lev, std::string_view line)
Definition log.cpp:336
bool is_tty
Definition log_internal.h:116
std::ostream & m_stream
Definition log_internal.h:115
StreamLogOutput stderr_output
StreamLogOutput stdout_output
Logger g_logger
Definition log.cpp:56
LogTimestamp
Definition log_internal.h:35
@ LOG_TIMESTAMP_RELATIVE
Definition log_internal.h:38
@ LOG_TIMESTAMP_NONE
Definition log_internal.h:36
@ LOG_TIMESTAMP_WALL
Definition log_internal.h:37
LogColor
Definition log_internal.h:29
@ LOG_COLOR_NEVER
Definition log_internal.h:30
@ LOG_COLOR_AUTO
Definition log_internal.h:32
@ LOG_COLOR_ALWAYS
Definition log_internal.h:31
LogLevel
Definition log_internal.h:18
@ LL_INFO
Definition log_internal.h:23
@ LL_ERROR
Definition log_internal.h:20
@ LL_NONE
Definition log_internal.h:19
@ LL_WARNING
Definition log_internal.h:21
@ LL_TRACE
Definition log_internal.h:25
@ LL_ACTION
Definition log_internal.h:22
@ LL_MAX
Definition log_internal.h:26
@ LL_VERBOSE
Definition log_internal.h:24
u8 LogLevelMask
Definition log_internal.h:41
std::lock_guard< std::mutex > MutexAutoLock
Definition mutex_auto_lock.h:31
Definition log_internal.h:132
LogLevel level
Definition log_internal.h:133
std::string timestamp
Definition log_internal.h:134
std::string thread_name
Definition log_internal.h:135
std::string combined
Definition log_internal.h:138
std::string text
Definition log_internal.h:136