aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Common/Logging/Targets/ConsoleLogTarget.cs
diff options
context:
space:
mode:
authorTSR Berry <20988865+TSRBerry@users.noreply.github.com>2023-04-08 01:22:00 +0200
committerMary <thog@protonmail.com>2023-04-27 23:51:14 +0200
commitcee712105850ac3385cd0091a923438167433f9f (patch)
tree4a5274b21d8b7f938c0d0ce18736d3f2993b11b1 /Ryujinx.Common/Logging/Targets/ConsoleLogTarget.cs
parentcd124bda587ef09668a971fa1cac1c3f0cfc9f21 (diff)
Move solution and projects to src
Diffstat (limited to 'Ryujinx.Common/Logging/Targets/ConsoleLogTarget.cs')
-rw-r--r--Ryujinx.Common/Logging/Targets/ConsoleLogTarget.cs41
1 files changed, 0 insertions, 41 deletions
diff --git a/Ryujinx.Common/Logging/Targets/ConsoleLogTarget.cs b/Ryujinx.Common/Logging/Targets/ConsoleLogTarget.cs
deleted file mode 100644
index 7b77c4f2..00000000
--- a/Ryujinx.Common/Logging/Targets/ConsoleLogTarget.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-using System;
-
-namespace Ryujinx.Common.Logging
-{
- public class ConsoleLogTarget : ILogTarget
- {
- private readonly ILogFormatter _formatter;
-
- private readonly string _name;
-
- string ILogTarget.Name { get => _name; }
-
- private static ConsoleColor GetLogColor(LogLevel level) => level switch {
- LogLevel.Info => ConsoleColor.White,
- LogLevel.Warning => ConsoleColor.Yellow,
- LogLevel.Error => ConsoleColor.Red,
- LogLevel.Stub => ConsoleColor.DarkGray,
- LogLevel.Notice => ConsoleColor.Cyan,
- LogLevel.Trace => ConsoleColor.DarkCyan,
- _ => ConsoleColor.Gray,
- };
-
- public ConsoleLogTarget(string name)
- {
- _formatter = new DefaultLogFormatter();
- _name = name;
- }
-
- public void Log(object sender, LogEventArgs args)
- {
- Console.ForegroundColor = GetLogColor(args.Level);
- Console.WriteLine(_formatter.Format(args));
- Console.ResetColor();
- }
-
- public void Dispose()
- {
- Console.ResetColor();
- }
- }
-}