summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-06-15 04:23:27 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-06-15 04:23:27 +0200
commit422a15ee758d3363ce0fa8bda185e34b5702c2a0 (patch)
tree2772d78ef38c55229da1cea67b2a34f85596470c /src
parentMerge pull request #6456 from Morph1984/very-important-changes (diff)
downloadyuzu-422a15ee758d3363ce0fa8bda185e34b5702c2a0.tar
yuzu-422a15ee758d3363ce0fa8bda185e34b5702c2a0.tar.gz
yuzu-422a15ee758d3363ce0fa8bda185e34b5702c2a0.tar.bz2
yuzu-422a15ee758d3363ce0fa8bda185e34b5702c2a0.tar.lz
yuzu-422a15ee758d3363ce0fa8bda185e34b5702c2a0.tar.xz
yuzu-422a15ee758d3363ce0fa8bda185e34b5702c2a0.tar.zst
yuzu-422a15ee758d3363ce0fa8bda185e34b5702c2a0.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/lm/lm.cpp47
1 files changed, 20 insertions, 27 deletions
diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp
index 311e4fb2d..794504314 100644
--- a/src/core/hle/service/lm/lm.cpp
+++ b/src/core/hle/service/lm/lm.cpp
@@ -51,6 +51,24 @@ struct hash<Service::LM::LogPacketHeaderEntry> {
} // namespace std
namespace Service::LM {
+namespace {
+std::string_view NameOf(LogSeverity severity) {
+ switch (severity) {
+ case LogSeverity::Trace:
+ return "TRACE";
+ case LogSeverity::Info:
+ return "INFO";
+ case LogSeverity::Warning:
+ return "WARNING";
+ case LogSeverity::Error:
+ return "ERROR";
+ case LogSeverity::Fatal:
+ return "FATAL";
+ default:
+ return "UNKNOWN";
+ }
+}
+} // Anonymous namespace
enum class LogDestination : u32 {
TargetManager = 1 << 0,
@@ -262,33 +280,8 @@ private:
if (text_log) {
output_log += fmt::format("Log Text: {}\n", *text_log);
}
-
- switch (entry.severity) {
- case LogSeverity::Trace:
- LOG_DEBUG(Service_LM, "LogManager TRACE ({}):\n{}", DestinationToString(destination),
- output_log);
- break;
- case LogSeverity::Info:
- LOG_INFO(Service_LM, "LogManager INFO ({}):\n{}", DestinationToString(destination),
- output_log);
- break;
- case LogSeverity::Warning:
- LOG_WARNING(Service_LM, "LogManager WARNING ({}):\n{}",
- DestinationToString(destination), output_log);
- break;
- case LogSeverity::Error:
- LOG_ERROR(Service_LM, "LogManager ERROR ({}):\n{}", DestinationToString(destination),
- output_log);
- break;
- case LogSeverity::Fatal:
- LOG_CRITICAL(Service_LM, "LogManager FATAL ({}):\n{}", DestinationToString(destination),
- output_log);
- break;
- default:
- LOG_CRITICAL(Service_LM, "LogManager UNKNOWN ({}):\n{}",
- DestinationToString(destination), output_log);
- break;
- }
+ LOG_DEBUG(Service_LM, "LogManager {} ({}):\n{}", NameOf(entry.severity),
+ DestinationToString(destination), output_log);
}
static std::string DestinationToString(LogDestination destination) {