An implementation of Logger that logs messages to an internal std::string buffer and provides read-on...
util::String_ostream m_os
Like ostringstream but allows for fast access directly into its internal string buffer.
const std::string & buffer_str() const
Read-only access to the buffer string containing the messages logged thus far.
void do_log(Msg_metadata *metadata, util::String_view msg) override
Implements interface method by synchronously logging the message and some subset of the metadata in a...
Buffer_logger(Config *config)
Constructs logger to subsequently log to a newly constructed internal std::string buffer.
Ostream_log_msg_writer m_os_writer
Wrapper around m_os that will take care of prefacing each message with time stamp,...
Config *const m_config
Reference to the config object passed to constructor. Note that object is mutable; see notes on threa...
util::Mutex_non_recursive m_log_mutex
Mutex protecting against log messages being logged, accessing m_os concurrently and thus corrupting (...
bool should_log(Sev sev, const Component &component) const override
Implements interface method by returning true if the severity and component (which is allowed to be n...
bool logs_asynchronously() const override
Implements interface method by returning false, indicating that this Logger will not need the content...
const std::string buffer_str_copy() const
Returns a copy of buffer_str() in thread-safe fashion.
A light-weight class, each object storing a component payload encoding an enum value from enum type o...
Class used to configure the filtering and logging behavior of Loggers; its use in your custom Loggers...
Interface that the user should implement, passing the implementing Logger into logging classes (Flow'...
Utility class, each object of which wraps a given ostream and outputs discrete messages to it adorned...
Similar to ostringstream but allows fast read-only access directly into the std::string being written...
Flow module providing logging functionality.
Sev
Enumeration containing one of several message severity levels, ordered from highest to lowest.
boost::mutex Mutex_non_recursive
Short-hand for non-reentrant, exclusive mutex. ("Reentrant" = one can lock an already-locked-in-that-...
Basic_string_view< char > String_view
Commonly used char-based Basic_string_view. See its doc header.