diff options
| author | 2021-09-30 16:11:47 -0400 | |
|---|---|---|
| committer | 2021-10-01 20:48:49 -0400 | |
| commit | 5daf3abe65bb168e4274049c26e7f309b8f10e82 (patch) | |
| tree | f62a59154b2ab0460e83f1bbfb02f93a3364ec3f | |
| parent | Merge pull request #7061 from ameerj/dma-buffer-misc (diff) | |
| download | yuzu-5daf3abe65bb168e4274049c26e7f309b8f10e82.tar.gz yuzu-5daf3abe65bb168e4274049c26e7f309b8f10e82.tar.xz yuzu-5daf3abe65bb168e4274049c26e7f309b8f10e82.zip | |
common/logging: Move Log::Entry declaration to a separate header
This reduces the load of requiring to include std::chrono in all files which include log.h
| -rw-r--r-- | src/audio_core/command_generator.cpp | 3 | ||||
| -rw-r--r-- | src/audio_core/mix_context.cpp | 2 | ||||
| -rw-r--r-- | src/audio_core/voice_context.cpp | 2 | ||||
| -rw-r--r-- | src/common/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/common/logging/backend.cpp | 3 | ||||
| -rw-r--r-- | src/common/logging/log.h | 4 | ||||
| -rw-r--r-- | src/common/logging/log_entry.h | 28 | ||||
| -rw-r--r-- | src/common/logging/text_formatter.cpp | 1 | ||||
| -rw-r--r-- | src/common/logging/types.h | 17 | ||||
| -rw-r--r-- | src/core/hle/kernel/k_auto_object_container.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/lbl/lbl.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 1 |
12 files changed, 48 insertions, 17 deletions
diff --git a/src/audio_core/command_generator.cpp b/src/audio_core/command_generator.cpp index 45b2eef52..830af46ad 100644 --- a/src/audio_core/command_generator.cpp +++ b/src/audio_core/command_generator.cpp | |||
| @@ -2,13 +2,16 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | ||
| 5 | #include <cmath> | 6 | #include <cmath> |
| 6 | #include <numbers> | 7 | #include <numbers> |
| 8 | |||
| 7 | #include "audio_core/algorithm/interpolate.h" | 9 | #include "audio_core/algorithm/interpolate.h" |
| 8 | #include "audio_core/command_generator.h" | 10 | #include "audio_core/command_generator.h" |
| 9 | #include "audio_core/effect_context.h" | 11 | #include "audio_core/effect_context.h" |
| 10 | #include "audio_core/mix_context.h" | 12 | #include "audio_core/mix_context.h" |
| 11 | #include "audio_core/voice_context.h" | 13 | #include "audio_core/voice_context.h" |
| 14 | #include "common/common_types.h" | ||
| 12 | #include "core/memory.h" | 15 | #include "core/memory.h" |
| 13 | 16 | ||
| 14 | namespace AudioCore { | 17 | namespace AudioCore { |
diff --git a/src/audio_core/mix_context.cpp b/src/audio_core/mix_context.cpp index 4bca72eb0..057aab5ad 100644 --- a/src/audio_core/mix_context.cpp +++ b/src/audio_core/mix_context.cpp | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | ||
| 6 | |||
| 5 | #include "audio_core/behavior_info.h" | 7 | #include "audio_core/behavior_info.h" |
| 6 | #include "audio_core/common.h" | 8 | #include "audio_core/common.h" |
| 7 | #include "audio_core/effect_context.h" | 9 | #include "audio_core/effect_context.h" |
diff --git a/src/audio_core/voice_context.cpp b/src/audio_core/voice_context.cpp index d8c954b60..75012a887 100644 --- a/src/audio_core/voice_context.cpp +++ b/src/audio_core/voice_context.cpp | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | ||
| 6 | |||
| 5 | #include "audio_core/behavior_info.h" | 7 | #include "audio_core/behavior_info.h" |
| 6 | #include "audio_core/voice_context.h" | 8 | #include "audio_core/voice_context.h" |
| 7 | #include "core/memory.h" | 9 | #include "core/memory.h" |
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index b18a2a2f5..cb5c0f326 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt | |||
| @@ -79,6 +79,7 @@ add_library(common STATIC | |||
| 79 | logging/filter.cpp | 79 | logging/filter.cpp |
| 80 | logging/filter.h | 80 | logging/filter.h |
| 81 | logging/log.h | 81 | logging/log.h |
| 82 | logging/log_entry.h | ||
| 82 | logging/text_formatter.cpp | 83 | logging/text_formatter.cpp |
| 83 | logging/text_formatter.h | 84 | logging/text_formatter.h |
| 84 | logging/types.h | 85 | logging/types.h |
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index e40d117d6..0e85a9c1d 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp | |||
| @@ -9,6 +9,8 @@ | |||
| 9 | #include <thread> | 9 | #include <thread> |
| 10 | #include <vector> | 10 | #include <vector> |
| 11 | 11 | ||
| 12 | #include <fmt/format.h> | ||
| 13 | |||
| 12 | #ifdef _WIN32 | 14 | #ifdef _WIN32 |
| 13 | #include <windows.h> // For OutputDebugStringW | 15 | #include <windows.h> // For OutputDebugStringW |
| 14 | #endif | 16 | #endif |
| @@ -22,6 +24,7 @@ | |||
| 22 | 24 | ||
| 23 | #include "common/logging/backend.h" | 25 | #include "common/logging/backend.h" |
| 24 | #include "common/logging/log.h" | 26 | #include "common/logging/log.h" |
| 27 | #include "common/logging/log_entry.h" | ||
| 25 | #include "common/logging/text_formatter.h" | 28 | #include "common/logging/text_formatter.h" |
| 26 | #include "common/settings.h" | 29 | #include "common/settings.h" |
| 27 | #ifdef _WIN32 | 30 | #ifdef _WIN32 |
diff --git a/src/common/logging/log.h b/src/common/logging/log.h index 8d43eddc7..34fd2c30b 100644 --- a/src/common/logging/log.h +++ b/src/common/logging/log.h | |||
| @@ -4,7 +4,11 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <algorithm> | ||
| 8 | #include <string_view> | ||
| 9 | |||
| 7 | #include <fmt/format.h> | 10 | #include <fmt/format.h> |
| 11 | |||
| 8 | #include "common/logging/types.h" | 12 | #include "common/logging/types.h" |
| 9 | 13 | ||
| 10 | namespace Common::Log { | 14 | namespace Common::Log { |
diff --git a/src/common/logging/log_entry.h b/src/common/logging/log_entry.h new file mode 100644 index 000000000..dd6f44841 --- /dev/null +++ b/src/common/logging/log_entry.h | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <chrono> | ||
| 8 | |||
| 9 | #include "common/logging/types.h" | ||
| 10 | |||
| 11 | namespace Common::Log { | ||
| 12 | |||
| 13 | /** | ||
| 14 | * A log entry. Log entries are store in a structured format to permit more varied output | ||
| 15 | * formatting on different frontends, as well as facilitating filtering and aggregation. | ||
| 16 | */ | ||
| 17 | struct Entry { | ||
| 18 | std::chrono::microseconds timestamp; | ||
| 19 | Class log_class{}; | ||
| 20 | Level log_level{}; | ||
| 21 | const char* filename = nullptr; | ||
| 22 | unsigned int line_num = 0; | ||
| 23 | std::string function; | ||
| 24 | std::string message; | ||
| 25 | bool final_entry = false; | ||
| 26 | }; | ||
| 27 | |||
| 28 | } // namespace Common::Log | ||
diff --git a/src/common/logging/text_formatter.cpp b/src/common/logging/text_formatter.cpp index cfc0d5846..10b2281db 100644 --- a/src/common/logging/text_formatter.cpp +++ b/src/common/logging/text_formatter.cpp | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include "common/common_funcs.h" | 13 | #include "common/common_funcs.h" |
| 14 | #include "common/logging/filter.h" | 14 | #include "common/logging/filter.h" |
| 15 | #include "common/logging/log.h" | 15 | #include "common/logging/log.h" |
| 16 | #include "common/logging/log_entry.h" | ||
| 16 | #include "common/logging/text_formatter.h" | 17 | #include "common/logging/text_formatter.h" |
| 17 | #include "common/string_util.h" | 18 | #include "common/string_util.h" |
| 18 | 19 | ||
diff --git a/src/common/logging/types.h b/src/common/logging/types.h index ddf9d27ca..2d21fc483 100644 --- a/src/common/logging/types.h +++ b/src/common/logging/types.h | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <chrono> | ||
| 8 | |||
| 9 | #include "common/common_types.h" | 7 | #include "common/common_types.h" |
| 10 | 8 | ||
| 11 | namespace Common::Log { | 9 | namespace Common::Log { |
| @@ -131,19 +129,4 @@ enum class Class : u8 { | |||
| 131 | Count ///< Total number of logging classes | 129 | Count ///< Total number of logging classes |
| 132 | }; | 130 | }; |
| 133 | 131 | ||
| 134 | /** | ||
| 135 | * A log entry. Log entries are store in a structured format to permit more varied output | ||
| 136 | * formatting on different frontends, as well as facilitating filtering and aggregation. | ||
| 137 | */ | ||
| 138 | struct Entry { | ||
| 139 | std::chrono::microseconds timestamp; | ||
| 140 | Class log_class{}; | ||
| 141 | Level log_level{}; | ||
| 142 | const char* filename = nullptr; | ||
| 143 | unsigned int line_num = 0; | ||
| 144 | std::string function; | ||
| 145 | std::string message; | ||
| 146 | bool final_entry = false; | ||
| 147 | }; | ||
| 148 | |||
| 149 | } // namespace Common::Log | 132 | } // namespace Common::Log |
diff --git a/src/core/hle/kernel/k_auto_object_container.cpp b/src/core/hle/kernel/k_auto_object_container.cpp index 010006bb7..d5f80d5b2 100644 --- a/src/core/hle/kernel/k_auto_object_container.cpp +++ b/src/core/hle/kernel/k_auto_object_container.cpp | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | ||
| 6 | |||
| 5 | #include "core/hle/kernel/k_auto_object_container.h" | 7 | #include "core/hle/kernel/k_auto_object_container.h" |
| 6 | 8 | ||
| 7 | namespace Kernel { | 9 | namespace Kernel { |
diff --git a/src/core/hle/service/lbl/lbl.cpp b/src/core/hle/service/lbl/lbl.cpp index 24890c830..37ff37277 100644 --- a/src/core/hle/service/lbl/lbl.cpp +++ b/src/core/hle/service/lbl/lbl.cpp | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <cmath> | ||
| 5 | #include <memory> | 6 | #include <memory> |
| 6 | 7 | ||
| 7 | #include "common/logging/log.h" | 8 | #include "common/logging/log.h" |
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 7f4ca6282..f22342dfb 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include <array> | 7 | #include <array> |
| 8 | #include <bitset> | 8 | #include <bitset> |
| 9 | #include <cmath> | ||
| 9 | #include <limits> | 10 | #include <limits> |
| 10 | #include <optional> | 11 | #include <optional> |
| 11 | #include <type_traits> | 12 | #include <type_traits> |