64 template <
typename IdType>
85 typedef std::map<std::thread::id, buffer_t> buffer_list_t;
95 std::lock_guard<std::recursive_mutex> lg{ mutex() };
96 thread_local struct cleanup
101 std::lock_guard<std::recursive_mutex> lg{ parent.mutex() };
102 parent.
buffers().erase(std::this_thread::get_id());
105 return iBuffers[std::this_thread::get_id()];
112 std::recursive_mutex& mutex()
const
117 mutable std::recursive_mutex iMutex;
118 buffer_list_t iBuffers;
133 template <std::
size_t Instance>
138 struct logging_thread_already_created : std::logic_error { logging_thread_already_created() :
std::logic_error{
"neolib::logger::i_logger::logging_thread_already_created" } {} };
166 template <
typename IdType>
171 template <
typename IdType>
176 template <
typename IdType>
181 template <
typename IdType>
189 return (*
this) << aCategory.
id;
195 flush(
string{ buffer.str() });
202 buffer << std::flush;
203 flush(
string{ buffer.str() });
226 iFormattingFunction{ aFormattingFunction }
232 iFormattingFunction(aLogger, aUnformattedMessage, aFormattedMessage);
std::ostringstream buffer_t
static client_logger_buffers & instance()
buffer_list_t & buffers()
virtual void clear_formatter()=0
i_logger & operator<<(endl_t)
virtual void reset_line_id(line_id_t aLineId=DefaultInitialLineId)=0
virtual void cancel_copy_to(i_logger &aLogger)=0
virtual bool category_enabled(category_id aId) const =0
void enable_category(IdType aId)
i_logger & operator<<(category aCategory)
virtual severity filter_severity() const =0
virtual void create_logging_thread()=0
i_logger & operator<<(T const &aValue)
void disable_category(IdType aId)
virtual void set_filter_severity(severity aSeverity)=0
virtual void enable_category(category_id aId)=0
virtual bool has_formatter() const =0
virtual void copy_to(i_logger &aLogger)=0
virtual i_logger & operator<<(severity aSeverity)=0
virtual void register_category(category_id aId, i_string const &aName)=0
virtual void flush(i_string const &aMessage)=0
virtual void wait() const =0
virtual i_formatter & formatter() const =0
virtual void set_formatter(i_formatter &aFormatter)=0
void register_category(IdType aId, std::string const &aName={})
virtual line_id_t line_id() const =0
void category_enabled(IdType aId)
virtual void disable_category(category_id aId)=0
virtual i_logger & operator<<(category_id aCategory)=0
virtual bool has_logging_thread() const =0
virtual ~i_logger()=default
i_logger & operator<<(flush_t)
constexpr line_id_t DefaultInitialLineId
#define declare_event(declName,...)