24 #if UUID_LOG_THREAD_SAFE
36 #if UUID_LOG_THREAD_SAFE
37 std::lock_guard<std::mutex> lock{
mutex_};
44 #if UUID_LOG_THREAD_SAFE
45 std::lock_guard<std::mutex> lock{
mutex_};
56 #if UUID_LOG_THREAD_SAFE
57 std::unique_lock<std::mutex> lock{
mutex_};
60 count = std::max((
size_t)1, count);
66 #if UUID_LOG_THREAD_SAFE
74 print_.print(message->name);
76 print_.println(message->text.c_str());
85 #if UUID_LOG_THREAD_SAFE
92 #if UUID_LOG_THREAD_SAFE
93 std::lock_guard<std::mutex> lock{
mutex_};
void operator<<(std::shared_ptr< Message > message) override
Add a new log message.
void loop(size_t count=SIZE_MAX)
Dispatch queued log messages.
size_t maximum_log_messages() const
Get the maximum number of queued log messages.
size_t maximum_log_messages_
std::list< std::shared_ptr< Message > > log_messages_
PrintHandler(Print &print)
Create a new Print log handler.
char format_level_char(Level level)
Format a log level as a single character.
std::string format_timestamp_ms(uint64_t timestamp_ms, unsigned int days_width)
Format a system uptime timestamp as a string.