diff options
| author | 2015-05-12 02:19:44 -0300 | |
|---|---|---|
| committer | 2015-05-12 02:31:04 -0300 | |
| commit | b88c91dd3d03f1a452cdd48f0db4e010cb150753 (patch) | |
| tree | 17ddf674e020be69d03cc1c3c49c3e041377603b /src/common/logging/text_formatter.cpp | |
| parent | Merge pull request #748 from Subv/tls_max (diff) | |
| download | yuzu-b88c91dd3d03f1a452cdd48f0db4e010cb150753.tar.gz yuzu-b88c91dd3d03f1a452cdd48f0db4e010cb150753.tar.xz yuzu-b88c91dd3d03f1a452cdd48f0db4e010cb150753.zip | |
Common: Remove async logging
It provided a large increase in complexity of the logging system while
having a negligible performance impact: the usage patterns of the ring
buffer meant that each log contended with the logging thread, causing
it to effectively act as a synchronous extra buffering.
Also removed some broken code related to filtering of subclasses which
was broken since it was introduced. (Which means no one ever used that
feature anyway, since, 8 months later, no one ever complained.)
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) { | |||
| 46 | unsigned int time_seconds = static_cast<unsigned int>(entry.timestamp.count() / 1000000); | 46 | unsigned int time_seconds = static_cast<unsigned int>(entry.timestamp.count() / 1000000); |
| 47 | unsigned int time_fractional = static_cast<unsigned int>(entry.timestamp.count() % 1000000); | 47 | unsigned int time_fractional = static_cast<unsigned int>(entry.timestamp.count() % 1000000); |
| 48 | 48 | ||
| 49 | const char* class_name = Logger::GetLogClassName(entry.log_class); | 49 | const char* class_name = GetLogClassName(entry.log_class); |
| 50 | const char* level_name = Logger::GetLevelName(entry.log_level); | 50 | const char* level_name = GetLevelName(entry.log_level); |
| 51 | 51 | ||
| 52 | snprintf(out_text, text_len, "[%4u.%06u] %s <%s> %s: %s", | 52 | snprintf(out_text, text_len, "[%4u.%06u] %s <%s> %s: %s", |
| 53 | time_seconds, time_fractional, class_name, level_name, | 53 | time_seconds, time_fractional, class_name, level_name, |
| @@ -116,19 +116,4 @@ void PrintColoredMessage(const Entry& entry) { | |||
| 116 | #endif | 116 | #endif |
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | void TextLoggingLoop(std::shared_ptr<Logger> logger) { | ||
| 120 | std::array<Entry, 256> entry_buffer; | ||
| 121 | |||
| 122 | while (true) { | ||
| 123 | size_t num_entries = logger->GetEntries(entry_buffer.data(), entry_buffer.size()); | ||
| 124 | if (num_entries == Logger::QUEUE_CLOSED) { | ||
| 125 | break; | ||
| 126 | } | ||
| 127 | for (size_t i = 0; i < num_entries; ++i) { | ||
| 128 | const Entry& entry = entry_buffer[i]; | ||
| 129 | PrintColoredMessage(entry); | ||
| 130 | } | ||
| 131 | } | ||
| 132 | } | ||
| 133 | |||
| 134 | } | 119 | } |