summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/CMakeLists.txt1
-rw-r--r--src/common/host_memory.cpp2
-rw-r--r--src/common/logging/backend.cpp3
-rw-r--r--src/common/logging/log.h6
-rw-r--r--src/common/logging/log_entry.h28
-rw-r--r--src/common/logging/text_formatter.cpp1
-rw-r--r--src/common/logging/types.h17
-rw-r--r--src/common/param_package.cpp1
-rw-r--r--src/common/settings.cpp2
-rw-r--r--src/common/settings.h2
10 files changed, 40 insertions, 23 deletions
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/host_memory.cpp b/src/common/host_memory.cpp
index 6661244cf..b44a44949 100644
--- a/src/common/host_memory.cpp
+++ b/src/common/host_memory.cpp
@@ -314,8 +314,8 @@ private:
314 } 314 }
315 315
316 void UntrackPlaceholder(boost::icl::separate_interval_set<size_t>::iterator it) { 316 void UntrackPlaceholder(boost::icl::separate_interval_set<size_t>::iterator it) {
317 placeholders.erase(it);
318 placeholder_host_pointers.erase(it->lower()); 317 placeholder_host_pointers.erase(it->lower());
318 placeholders.erase(it);
319 } 319 }
320 320
321 /// Return true when a given memory region is a "nieche" and the placeholders don't have to be 321 /// Return true when a given memory region is a "nieche" and the placeholders don't have to be
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..c186d55ef 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 <fmt/format.h> 7#include <algorithm>
8#include <string_view>
9
10#include <fmt/core.h>
11
8#include "common/logging/types.h" 12#include "common/logging/types.h"
9 13
10namespace Common::Log { 14namespace 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
11namespace 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 */
17struct 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
11namespace Common::Log { 9namespace 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 */
138struct 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/common/param_package.cpp b/src/common/param_package.cpp
index b916b4866..bbf20f5eb 100644
--- a/src/common/param_package.cpp
+++ b/src/common/param_package.cpp
@@ -3,6 +3,7 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <array> 5#include <array>
6#include <stdexcept>
6#include <utility> 7#include <utility>
7#include <vector> 8#include <vector>
8 9
diff --git a/src/common/settings.cpp b/src/common/settings.cpp
index 69f0bd8c0..9dd5e3efb 100644
--- a/src/common/settings.cpp
+++ b/src/common/settings.cpp
@@ -69,8 +69,6 @@ void LogSettings() {
69 log_path("DataStorage_NANDDir", Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir)); 69 log_path("DataStorage_NANDDir", Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir));
70 log_path("DataStorage_SDMCDir", Common::FS::GetYuzuPath(Common::FS::YuzuPath::SDMCDir)); 70 log_path("DataStorage_SDMCDir", Common::FS::GetYuzuPath(Common::FS::YuzuPath::SDMCDir));
71 log_setting("Debugging_ProgramArgs", values.program_args.GetValue()); 71 log_setting("Debugging_ProgramArgs", values.program_args.GetValue());
72 log_setting("Services_BCATBackend", values.bcat_backend.GetValue());
73 log_setting("Services_BCATBoxcatLocal", values.bcat_boxcat_local.GetValue());
74 log_setting("Input_EnableMotion", values.motion_enabled.GetValue()); 72 log_setting("Input_EnableMotion", values.motion_enabled.GetValue());
75 log_setting("Input_EnableVibration", values.vibration_enabled.GetValue()); 73 log_setting("Input_EnableVibration", values.vibration_enabled.GetValue());
76 log_setting("Input_EnableRawInput", values.enable_raw_input.GetValue()); 74 log_setting("Input_EnableRawInput", values.enable_raw_input.GetValue());
diff --git a/src/common/settings.h b/src/common/settings.h
index c53d5acc3..402339443 100644
--- a/src/common/settings.h
+++ b/src/common/settings.h
@@ -568,8 +568,6 @@ struct Values {
568 BasicSetting<bool> use_dev_keys{false, "use_dev_keys"}; 568 BasicSetting<bool> use_dev_keys{false, "use_dev_keys"};
569 569
570 // Network 570 // Network
571 BasicSetting<std::string> bcat_backend{"none", "bcat_backend"};
572 BasicSetting<bool> bcat_boxcat_local{false, "bcat_boxcat_local"};
573 BasicSetting<std::string> network_interface{std::string(), "network_interface"}; 571 BasicSetting<std::string> network_interface{std::string(), "network_interface"};
574 572
575 // WebService 573 // WebService