summaryrefslogtreecommitdiff
path: root/src/core/hle
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/service/lm/manager.cpp12
-rw-r--r--src/core/hle/service/lm/manager.h4
2 files changed, 11 insertions, 5 deletions
diff --git a/src/core/hle/service/lm/manager.cpp b/src/core/hle/service/lm/manager.cpp
index fd8edaf46..b67081b86 100644
--- a/src/core/hle/service/lm/manager.cpp
+++ b/src/core/hle/service/lm/manager.cpp
@@ -13,7 +13,7 @@ namespace Service::LM {
13std::ostream& operator<<(std::ostream& os, DestinationFlag dest) { 13std::ostream& operator<<(std::ostream& os, DestinationFlag dest) {
14 std::vector<std::string> array; 14 std::vector<std::string> array;
15 const auto check_single_flag = [dest, &array](DestinationFlag check, std::string name) { 15 const auto check_single_flag = [dest, &array](DestinationFlag check, std::string name) {
16 if ((static_cast<u32>(check) & static_cast<u32>(dest)) > 0) { 16 if ((static_cast<u32>(check) & static_cast<u32>(dest)) != 0) {
17 array.emplace_back(std::move(name)); 17 array.emplace_back(std::move(name));
18 } 18 }
19 }; 19 };
@@ -75,7 +75,7 @@ std::string FormatField(Field type, const std::vector<u8>& data) {
75 if (data.size() >= sizeof(u32)) { 75 if (data.size() >= sizeof(u32)) {
76 u32 line; 76 u32 line;
77 std::memcpy(&line, data.data(), sizeof(u32)); 77 std::memcpy(&line, data.data(), sizeof(u32));
78 return fmt::format("{:08X}", line); 78 return fmt::format("{}", line);
79 } 79 }
80 return "[ERROR DECODING LINE NUMBER]"; 80 return "[ERROR DECODING LINE NUMBER]";
81 case Field::Message: 81 case Field::Message:
@@ -114,16 +114,20 @@ void Manager::Log(LogMessage message) {
114 } 114 }
115} 115}
116 116
117void Manager::Flush() {
118 FinalizeLog();
119}
120
117void Manager::InitializeLog() { 121void Manager::InitializeLog() {
118 current_log.clear(); 122 current_log.clear();
119 123
120 LOG_INFO(Service_LM, "Initialized new log session!"); 124 LOG_INFO(Service_LM, "Initialized new log session");
121} 125}
122 126
123void Manager::FinalizeLog() { 127void Manager::FinalizeLog() {
124 reporter.SaveLogReport(static_cast<u32>(destination), std::move(current_log)); 128 reporter.SaveLogReport(static_cast<u32>(destination), std::move(current_log));
125 129
126 LOG_INFO(Service_LM, "Finalized current log session!"); 130 LOG_INFO(Service_LM, "Finalized current log session");
127} 131}
128 132
129} // namespace Service::LM 133} // namespace Service::LM
diff --git a/src/core/hle/service/lm/manager.h b/src/core/hle/service/lm/manager.h
index af0a27257..544e636ba 100644
--- a/src/core/hle/service/lm/manager.h
+++ b/src/core/hle/service/lm/manager.h
@@ -81,7 +81,7 @@ std::string FormatField(Field type, const std::vector<u8>& data);
81 81
82class Manager { 82class Manager {
83public: 83public:
84 Manager(Core::Reporter& reporter); 84 explicit Manager(Core::Reporter& reporter);
85 ~Manager(); 85 ~Manager();
86 86
87 void SetEnabled(bool enabled); 87 void SetEnabled(bool enabled);
@@ -89,6 +89,8 @@ public:
89 89
90 void Log(LogMessage message); 90 void Log(LogMessage message);
91 91
92 void Flush();
93
92private: 94private:
93 void InitializeLog(); 95 void InitializeLog();
94 void FinalizeLog(); 96 void FinalizeLog();