13 inline error_context_stream::error_context_stream() noexcept
14 : base_logger_stream({ .bProtectLog =
false, .eMinFlushVerbosity = verbosity::none })
15 , m_Data(qx::make_unique_ref<error_context_stream_data>())
22 return m_Data->onMessages;
28 return m_Data->onError;
33 error_context_stream_data& data = *m_Data;
34 data.disabledThreads.lock()->push_back(errorThreadId);
35 data.onError.lock()->execute(errorThreadId);
36 std::erase(*data.disabledThreads.lock(), errorThreadId);
39 inline bool error_context_stream::log_unconditionally_required(
42 std::thread::id threadId,
43 std::chrono::system_clock::time_point messageTime,
45 string_view svFunction,
46 int nLine)
const noexcept
48 return m_Data.get().onMessages.lock()->contains(threadId);
51 inline void error_context_stream::do_log(
52 const category& category,
54 std::thread::id threadId,
55 std::chrono::system_clock::time_point messageTime,
57 string_view svFunction,
59 string_view svMessage)
61 error_context_stream_data& data = *m_Data;
62 if (!
contains(*data.disabledThreads.lock(), threadId))
63 (*data.onMessages.lock())[threadId].execute(eVerbosity, svMessage);
66 inline void error_context_stream::do_flush()
A category is a class that identifies a particular piece of code. This code can be located in differe...
threads_shared< on_message_delegates_map_t > & get_on_messages() noexcept
Get on messages delegate.
void on_error(std::thread::id errorThreadId) noexcept
Emit error event for all listeners.
threads_shared< on_error_delegate, std::recursive_mutex > & get_on_error() noexcept
Get on error delegate.
A class that provides thread-safe access to an object, including construction and destruction.
Check that tuple type contains T.