diff options
| -rw-r--r-- | src/core/hle/service/lm/lm.cpp | 47 |
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> { | |||
| 51 | } // namespace std | 51 | } // namespace std |
| 52 | 52 | ||
| 53 | namespace Service::LM { | 53 | namespace Service::LM { |
| 54 | namespace { | ||
| 55 | std::string_view NameOf(LogSeverity severity) { | ||
| 56 | switch (severity) { | ||
| 57 | case LogSeverity::Trace: | ||
| 58 | return "TRACE"; | ||
| 59 | case LogSeverity::Info: | ||
| 60 | return "INFO"; | ||
| 61 | case LogSeverity::Warning: | ||
| 62 | return "WARNING"; | ||
| 63 | case LogSeverity::Error: | ||
| 64 | return "ERROR"; | ||
| 65 | case LogSeverity::Fatal: | ||
| 66 | return "FATAL"; | ||
| 67 | default: | ||
| 68 | return "UNKNOWN"; | ||
| 69 | } | ||
| 70 | } | ||
| 71 | } // Anonymous namespace | ||
| 54 | 72 | ||
| 55 | enum class LogDestination : u32 { | 73 | enum class LogDestination : u32 { |
| 56 | TargetManager = 1 << 0, | 74 | TargetManager = 1 << 0, |
| @@ -262,33 +280,8 @@ private: | |||
| 262 | if (text_log) { | 280 | if (text_log) { |
| 263 | output_log += fmt::format("Log Text: {}\n", *text_log); | 281 | output_log += fmt::format("Log Text: {}\n", *text_log); |
| 264 | } | 282 | } |
| 265 | 283 | LOG_DEBUG(Service_LM, "LogManager {} ({}):\n{}", NameOf(entry.severity), | |
| 266 | switch (entry.severity) { | 284 | DestinationToString(destination), output_log); |
| 267 | case LogSeverity::Trace: | ||
| 268 | LOG_DEBUG(Service_LM, "LogManager TRACE ({}):\n{}", DestinationToString(destination), | ||
| 269 | output_log); | ||
| 270 | break; | ||
| 271 | case LogSeverity::Info: | ||
| 272 | LOG_INFO(Service_LM, "LogManager INFO ({}):\n{}", DestinationToString(destination), | ||
| 273 | output_log); | ||
| 274 | break; | ||
| 275 | case LogSeverity::Warning: | ||
| 276 | LOG_WARNING(Service_LM, "LogManager WARNING ({}):\n{}", | ||
| 277 | DestinationToString(destination), output_log); | ||
| 278 | break; | ||
| 279 | case LogSeverity::Error: | ||
| 280 | LOG_ERROR(Service_LM, "LogManager ERROR ({}):\n{}", DestinationToString(destination), | ||
| 281 | output_log); | ||
| 282 | break; | ||
| 283 | case LogSeverity::Fatal: | ||
| 284 | LOG_CRITICAL(Service_LM, "LogManager FATAL ({}):\n{}", DestinationToString(destination), | ||
| 285 | output_log); | ||
| 286 | break; | ||
| 287 | default: | ||
| 288 | LOG_CRITICAL(Service_LM, "LogManager UNKNOWN ({}):\n{}", | ||
| 289 | DestinationToString(destination), output_log); | ||
| 290 | break; | ||
| 291 | } | ||
| 292 | } | 285 | } |
| 293 | 286 | ||
| 294 | static std::string DestinationToString(LogDestination destination) { | 287 | static std::string DestinationToString(LogDestination destination) { |