18 template<
class char_t >
21 static auto& get() noexcept
30 static auto& get() noexcept
36 template<
class char_t >
39 static auto& get() noexcept
48 static auto& get() noexcept
57 : m_pMutex(std::make_unique<std::recursive_mutex>())
58 , m_eMinFlushVerbosity(streamConfig.eMinFlushVerbosity)
59 , m_bProtectLog(streamConfig.bProtectLog)
67 if (eResult == compile_pattern_result::ok)
68 m_optPattern = std::move(sPattern);
75 return m_optPattern ? std::optional<string_view>(*m_optPattern) : std::nullopt;
81 std::thread::id threadId,
82 std::chrono::system_clock::time_point messageTime,
84 string_view svFunction,
86 string_view svMessage)
93 do_log(
category, eVerbosity, threadId, messageTime, svFile, svFunction, nLine, svMessage);
95 if (eVerbosity >= m_eMinFlushVerbosity)
104 QX_PERF_SCOPE(
"Flush");
117 verbosity eVerbosity,
118 std::thread::id threadId,
119 std::chrono::system_clock::time_point messageTime,
121 string_view svFunction,
122 int nLine)
const noexcept
#define QX_SET_FILE_CATEGORY(_category)
Set the file category You can access this value via QX_GET_FILE_CATEGORY() This category will not be ...
virtual bool log_unconditionally_required(const category &category, verbosity eVerbosity, std::thread::id threadId, std::chrono::system_clock::time_point messageTime, string_view svFile, string_view svFunction, int nLine) const noexcept
Returns true if this message should be processed by this stream even if the logger filters did not pa...
std::optional< string_view > get_pattern() const noexcept
Get a message pattern if present.
compile_pattern_result set_pattern(pattern_string_t sPattern) noexcept
Set a message pattern that will be used for this stream.
void log(const category &category, verbosity eVerbosity, std::thread::id threadId, std::chrono::system_clock::time_point messageTime, string_view svFile, string_view svFunction, int nLine, string_view svMessage)
Output to stream.
void flush()
Flush the stream.
base_logger_stream(const config &streamConfig) noexcept
base_logger_stream object constructor
A category is a class that identifies a particular piece of code. This code can be located in differe...
compile_pattern_result compile_pattern(basic_string< char_t, traits_t > &sPattern) noexcept
Compile an fmt pattern with named arguments into replacement fields.