20 #include <unordered_map>
29 std::pair<size_t, size_t> range { 0, 0 };
30 color rangeColor = color::white();
38 std::vector<logger_color_range> colors;
49 using format_func = std::function<void(
54 string_view svFunction,
56 string_view swLogMessage)>;
58 verbosity eMinVerbosity = verbosity::log;
59 format_func formatFunc;
65 string_view svUnitName;
80 static constexpr
const char_type* k_svDefaultUnit = QX_TEXT(
"default");
107 verbosity eVerbosity,
110 string_view svFunction,
112 string_view swLogMessage);
137 verbosity eVerbosity,
139 string_view svFunction)
const noexcept;
147 static void append_time_string(
string& sTime, char_type chDateDelimiter, char_type chTimeDelimiter) noexcept;
168 verbosity eVerbosity,
171 string_view svFunction,
173 string_view swLogMessage) noexcept;
184 string_view svMessage,
187 verbosity eVerbosity) = 0;
192 QX_PERF_MUTEX(m_LoggerStreamMutex);
193 bool m_bAlwaysFlush = false;
198 #include <qx/logger/base_logger_stream.inl>
#define QX_DEFINE_CATEGORY(name,...)
Define a category.
Base class for logger streams.
static void append_time_string(string &sTime, char_type chDateDelimiter, char_type chTimeDelimiter) noexcept
Format time string to the buffer.
void log(verbosity eVerbosity, const category &category, string_view svFile, string_view svFunction, int nLine, string_view swLogMessage)
Output to stream.
std::optional< log_unit > get_unit_info(const category &category, verbosity eVerbosity, string_view svFile, string_view svFunction) const noexcept
Try to find log unit info based on trace location info.
logger_buffer & get_log_buffer() noexcept
Get string buffers.
virtual void flush()=0
Flush stream.
void deregister_unit(string_view svUnitName) noexcept
Deregister logger unit.
base_logger_stream(bool bAlwaysFlush)
base_logger_stream object constructor
void register_unit(string_view svUnitName, const log_unit_info &unit) noexcept
Register logger unit.
virtual void format_line(logger_buffer &buffers, verbosity eVerbosity, const category &category, string_view svFile, string_view svFunction, int nLine, string_view swLogMessage) noexcept
Format logger line.
A category is a class that identifies a particular piece of code. This code can be located in differe...
Contains perf scope macros for profiler (for internal usage only, but user may override them)