summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/lm
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2019-09-22 18:28:21 +0200
committerZach Hilman <zachhilman@gmail.com>2019-09-22 18:34:55 +0200
commit6212df3beb38d0484b6ceedad18be99f107f7d96 (patch)
treefea1951fc95ba679834f2d690b19cc7b3de2e574 /src/core/hle/service/lm
parentlm: Rename Initialize to Log and implement with manager/reporter (diff)
downloadyuzu-6212df3beb38d0484b6ceedad18be99f107f7d96.tar
yuzu-6212df3beb38d0484b6ceedad18be99f107f7d96.tar.gz
yuzu-6212df3beb38d0484b6ceedad18be99f107f7d96.tar.bz2
yuzu-6212df3beb38d0484b6ceedad18be99f107f7d96.tar.lz
yuzu-6212df3beb38d0484b6ceedad18be99f107f7d96.tar.xz
yuzu-6212df3beb38d0484b6ceedad18be99f107f7d96.tar.zst
yuzu-6212df3beb38d0484b6ceedad18be99f107f7d96.zip
Diffstat (limited to 'src/core/hle/service/lm')
-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 {
std::ostream& operator<<(std::ostream& os, DestinationFlag dest) {
std::vector<std::string> array;
const auto check_single_flag = [dest, &array](DestinationFlag check, std::string name) {
- if ((static_cast<u32>(check) & static_cast<u32>(dest)) > 0) {
+ if ((static_cast<u32>(check) & static_cast<u32>(dest)) != 0) {
array.emplace_back(std::move(name));
}
};
@@ -75,7 +75,7 @@ std::string FormatField(Field type, const std::vector<u8>& data) {
if (data.size() >= sizeof(u32)) {
u32 line;
std::memcpy(&line, data.data(), sizeof(u32));
- return fmt::format("{:08X}", line);
+ return fmt::format("{}", line);
}
return "[ERROR DECODING LINE NUMBER]";
case Field::Message:
@@ -114,16 +114,20 @@ void Manager::Log(LogMessage message) {
}
}
+void Manager::Flush() {
+ FinalizeLog();
+}
+
void Manager::InitializeLog() {
current_log.clear();
- LOG_INFO(Service_LM, "Initialized new log session!");
+ LOG_INFO(Service_LM, "Initialized new log session");
}
void Manager::FinalizeLog() {
reporter.SaveLogReport(static_cast<u32>(destination), std::move(current_log));
- LOG_INFO(Service_LM, "Finalized current log session!");
+ LOG_INFO(Service_LM, "Finalized current log session");
}
} // 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);
class Manager {
public:
- Manager(Core::Reporter& reporter);
+ explicit Manager(Core::Reporter& reporter);
~Manager();
void SetEnabled(bool enabled);
@@ -89,6 +89,8 @@ public:
void Log(LogMessage message);
+ void Flush();
+
private:
void InitializeLog();
void FinalizeLog();