Beautify starting exceptions
MODIFY
WalletWasabi.Backend/InitConfigStartupTask.cs
WalletWasabi.Backend/InitConfigStartupTask.cs
@@ -28,7 +28,7 @@ namespace WalletWasabi.Backend
public async Task ExecuteAsync(CancellationToken cancellationToken)
{
Logger.InitializeDefaults(Path.Combine(Global.DataDir, "Logs.txt"));
- Logger.LogStarting("Wasabi Backend");
+ Logger.LogSoftwareStarted("Wasabi Backend");
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;

MODIFY
WalletWasabi.Backend/Startup.cs
WalletWasabi.Backend/Startup.cs
@@ -121,7 +121,7 @@ namespace WalletWasabi.Backend
Logger.LogInfo($"{nameof(global.LocalNode)} is disposed.");
}
- Logger.LogInfo("Wasabi Backend stopped gracefully.");
+ Logger.LogSoftwareStopped("Wasabi Backend");
}
}
}

MODIFY
WalletWasabi.Gui/CommandLine/Daemon.cs
WalletWasabi.Gui/CommandLine/Daemon.cs
@@ -23,7 +23,7 @@ namespace WalletWasabi.Gui.CommandLine
{
try
{
- Logger.LogStarting("Wasabi Daemon");
+ Logger.LogSoftwareStarted("Wasabi Daemon");
KeyManager keyManager = TryGetKeyManagerFromWalletName(walletName);
if (keyManager is null)

MODIFY
WalletWasabi.Gui/Global.cs
WalletWasabi.Gui/Global.cs
@@ -180,7 +180,7 @@ namespace WalletWasabi.Gui
});
await DisposeAsync();
- Logger.LogInfo($"Wasabi stopped gracefully.");
+ Logger.LogSoftwareStopped("Wasabi");
};
#endregion ProcessKillSubscription

MODIFY
WalletWasabi.Gui/Program.cs
WalletWasabi.Gui/Program.cs
@@ -40,7 +40,7 @@ namespace WalletWasabi.Gui
{
return;
}
- Logger.LogStarting("Wasabi GUI");
+ Logger.LogSoftwareStarted("Wasabi GUI");
BuildAvaloniaApp()
.BeforeStarting(async builder =>
@@ -75,7 +75,7 @@ namespace WalletWasabi.Gui
if (runGui)
{
- Logger.LogInfo($"Wasabi GUI stopped gracefully.");
+ Logger.LogSoftwareStopped("Wasabi GUI");
}
}
}

MODIFY
WalletWasabi/Logging/Logger.cs
WalletWasabi/Logging/Logger.cs
@@ -286,10 +286,18 @@ namespace WalletWasabi.Logging
#region InfoLoggingMethods
/// <summary>
- /// Logs software start with category InstanceGuid and insert three newlines.
+ /// Logs software starting with InstanceGuid and insert three newlines.
/// </summary>
/// <param name="appName">The name of the app.</param>
- public static void LogStarting(string appName, [CallerFilePath] string callerFilePath = "", [CallerLineNumber] int callerLineNumber = -1) => Log(LogLevel.Info, $"{appName} is starting...", additionalEntrySeparators: 3, additionalEntrySeparatorsLogFileOnlyMode: true, callerFilePath: callerFilePath, callerLineNumber: callerLineNumber);
+ public static void LogSoftwareStarted(string appName, [CallerFilePath] string callerFilePath = "", [CallerLineNumber] int callerLineNumber = -1)
+ => Log(LogLevel.Info, $"{appName} started ({InstanceGuid}).", additionalEntrySeparators: 3, additionalEntrySeparatorsLogFileOnlyMode: true, callerFilePath: callerFilePath, callerLineNumber: callerLineNumber);
+
+ /// <summary>
+ /// Logs software stopped with InstanceGuid.
+ /// </summary>
+ /// <param name="appName">The name of the app.</param>
+ public static void LogSoftwareStopped(string appName, [CallerFilePath] string callerFilePath = "", [CallerLineNumber] int callerLineNumber = -1)
+ => Log(LogLevel.Info, $"{appName} stopped gracefully ({InstanceGuid}).", callerFilePath: callerFilePath, callerLineNumber: callerLineNumber);
/// <summary>
/// For tracking the general flow of the application.

Beautify starting exceptions