diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-05-15 20:54:48 -0700 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-05-15 20:54:48 -0700 |
commit | ba2fe7f795ebc8da4acd247436afeefb900645d3 (patch) | |
tree | be9a2cbcdd840f41be5353a33a98bff3ca31544e /src/common/logging/text_formatter.cpp | |
parent | 742fd191a955d9971b527b25f366820ff5ddbf7b (diff) | |
parent | 7dbc27ff57d24a1c4e04e3f8cc35773ff9288516 (diff) |
Merge pull request #758 from yuriks/sync-logging
Common: Remove async logging
Diffstat (limited to 'src/common/logging/text_formatter.cpp')
-rw-r--r-- | src/common/logging/text_formatter.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/common/logging/text_formatter.cpp b/src/common/logging/text_formatter.cpp index 45be6d0a1..94f3dfc1f 100644 --- a/src/common/logging/text_formatter.cpp +++ b/src/common/logging/text_formatter.cpp @@ -46,8 +46,8 @@ void FormatLogMessage(const Entry& entry, char* out_text, size_t text_len) { unsigned int time_seconds = static_cast<unsigned int>(entry.timestamp.count() / 1000000); unsigned int time_fractional = static_cast<unsigned int>(entry.timestamp.count() % 1000000); - const char* class_name = Logger::GetLogClassName(entry.log_class); - const char* level_name = Logger::GetLevelName(entry.log_level); + const char* class_name = GetLogClassName(entry.log_class); + const char* level_name = GetLevelName(entry.log_level); snprintf(out_text, text_len, "[%4u.%06u] %s <%s> %s: %s", time_seconds, time_fractional, class_name, level_name, @@ -116,19 +116,4 @@ void PrintColoredMessage(const Entry& entry) { #endif } -void TextLoggingLoop(std::shared_ptr<Logger> logger) { - std::array<Entry, 256> entry_buffer; - - while (true) { - size_t num_entries = logger->GetEntries(entry_buffer.data(), entry_buffer.size()); - if (num_entries == Logger::QUEUE_CLOSED) { - break; - } - for (size_t i = 0; i < num_entries; ++i) { - const Entry& entry = entry_buffer[i]; - PrintColoredMessage(entry); - } - } -} - } |