diff --git a/Aaru.Gui/ConsoleHandler.cs b/Aaru.Gui/ConsoleHandler.cs index a854736a5..9db993797 100644 --- a/Aaru.Gui/ConsoleHandler.cs +++ b/Aaru.Gui/ConsoleHandler.cs @@ -54,13 +54,13 @@ static class ConsoleHandler if(_debug) { - AaruLogging.DebugWithModuleEvent += OnDebugWriteHandler; - AaruLogging.WriteExceptionEvent += OnWriteExceptionEvent; + AaruLogging.DebugEvent += OnDebugWriteHandler; + AaruLogging.WriteExceptionEvent += OnWriteExceptionEvent; } else { - AaruLogging.DebugWithModuleEvent -= OnDebugWriteHandler; - AaruLogging.WriteExceptionEvent -= OnWriteExceptionEvent; + AaruLogging.DebugEvent -= OnDebugWriteHandler; + AaruLogging.WriteExceptionEvent -= OnWriteExceptionEvent; } } } @@ -77,8 +77,8 @@ static class ConsoleHandler internal static void Init() { - AaruLogging.WriteLineEvent += OnWriteHandler; - AaruLogging.ErrorEvent += OnErrorWriteHandler; + AaruLogging.WriteLineEvent += OnWriteHandler; + AaruLogging.ErrorEvent += OnErrorWriteHandler; } static void OnWriteHandler([CanBeNull] string format, [CanBeNull] params object[] arg) diff --git a/Aaru.Logging/AaruLogging.cs b/Aaru.Logging/AaruLogging.cs index 634be3068..aaafe0f0b 100644 --- a/Aaru.Logging/AaruLogging.cs +++ b/Aaru.Logging/AaruLogging.cs @@ -54,9 +54,6 @@ public static class AaruLogging /// Event to receive line terminations to the debug output console. public static event DebugDelegate DebugEvent; - /// Event to receive writings to the debug output console that should be followed by a line termination. - public static event DebugWithModuleDelegate DebugWithModuleEvent; - /// Event to receive writings to the standard output console. public static event WriteDelegate WriteEvent; @@ -94,11 +91,8 @@ public static class AaruLogging /// Description of the module writing to the debug console /// A composite format string. /// An array of objects to write using . - public static void Debug(string module, string format, params object[] arg) - { - DebugEvent?.Invoke($"[blue]({module}):[/] {format}", arg); - DebugWithModuleEvent?.Invoke(module, format, arg); - } + public static void Debug(string module, string format, params object[] arg) => + DebugEvent?.Invoke(module, format, arg); /// Writes the current line terminator to the standard output console. public static void WriteLine() => WriteLineEvent?.Invoke("", null); diff --git a/Aaru.Logging/Delegates.cs b/Aaru.Logging/Delegates.cs index 5ea274c1c..72ae2d5e4 100644 --- a/Aaru.Logging/Delegates.cs +++ b/Aaru.Logging/Delegates.cs @@ -42,14 +42,6 @@ public delegate void WriteDelegate(string format, params object[] arg); /// An array of objects to write using . public delegate void VerboseWriteHandler(string format, params object[] arg); -/// -/// Writes the text representation of the specified array of objects, to the debug output console using the -/// specified format information. -/// -/// A composite format string. -/// An array of objects to write using . -public delegate void DebugDelegate(string format, params object[] arg); - /// /// Writes the text representation of the specified array of objects, followed by the current line terminator, to /// the debug output console using the specified format information. @@ -57,7 +49,7 @@ public delegate void DebugDelegate(string format, params object[] arg); /// Description of the module writing to the debug console /// A composite format string. /// An array of objects to write using . -public delegate void DebugWithModuleDelegate(string module, string format, params object[] arg); +public delegate void DebugDelegate(string module, string format, params object[] arg); /// /// Writes the exception to the debug output console. diff --git a/Aaru/Main.cs b/Aaru/Main.cs index 1e4a72184..68dabdbe0 100644 --- a/Aaru/Main.cs +++ b/Aaru/Main.cs @@ -114,7 +114,7 @@ class MainClass AaruLogging.VerboseEvent += Log.Verbose; - AaruLogging.DebugEvent += Log.Debug; + AaruLogging.DebugEvent += (module, format, objects) => Log.Debug($"[blue]{module}[/] {format}", objects); AaruLogging.WriteExceptionEvent += ex => Log.Error(ex, "Unhandled exception");