Create a public Log function in Logger.
MODIFY
WalletWasabi/Logging/BenchmarkLogger.cs
WalletWasabi/Logging/BenchmarkLogger.cs
@@ -46,36 +46,7 @@ namespace WalletWasabi.Logging
var elapsedSeconds = Math.Round((DateTimeOffset.UtcNow - InitStart).TotalSeconds, 1);
string message = $"{OperationName} finished in {elapsedSeconds} seconds.";
- switch (LogLevel)
- {
- case LogLevel.Trace:
- Logger.LogTrace(message, CallerFilePath, CallerLineNumber);
- break;
-
- case LogLevel.Debug:
- Logger.LogDebug(message, CallerFilePath, CallerLineNumber);
- break;
-
- case LogLevel.Info:
- Logger.LogInfo(message, CallerFilePath, CallerLineNumber);
- break;
-
- case LogLevel.Warning:
- Logger.LogWarning(message, CallerFilePath, CallerLineNumber);
- break;
-
- case LogLevel.Error:
- Logger.LogError(message, CallerFilePath, CallerLineNumber);
- break;
-
- case LogLevel.Critical:
- Logger.LogCritical(message, CallerFilePath, CallerLineNumber);
- break;
-
- default:
- Logger.LogInfo(message, CallerFilePath, CallerLineNumber);
- break;
- }
+ Logger.Log(LogLevel, message, CallerFilePath, CallerLineNumber);
}
_disposedValue = true;

MODIFY
WalletWasabi/Logging/Logger.cs
WalletWasabi/Logging/Logger.cs
@@ -108,6 +108,40 @@ namespace WalletWasabi.Logging
#region GeneralLoggingMethods
+ public static void Log(LogLevel level, string message, [CallerFilePath] string callerFilePath = "", [CallerLineNumber] int callerLineNumber = -1)
+ {
+ switch (level)
+ {
+ case LogLevel.Trace:
+ LogTrace(message, callerFilePath, callerLineNumber);
+ break;
+
+ case LogLevel.Debug:
+ LogDebug(message, callerFilePath, callerLineNumber);
+ break;
+
+ case LogLevel.Info:
+ LogInfo(message, callerFilePath, callerLineNumber);
+ break;
+
+ case LogLevel.Warning:
+ LogWarning(message, callerFilePath, callerLineNumber);
+ break;
+
+ case LogLevel.Error:
+ LogError(message, callerFilePath, callerLineNumber);
+ break;
+
+ case LogLevel.Critical:
+ LogCritical(message, callerFilePath, callerLineNumber);
+ break;
+
+ default:
+ LogInfo(message, callerFilePath, callerLineNumber);
+ break;
+ }
+ }
+
private static void Log(LogLevel level, string message, int additionalEntrySeparators = 0, bool additionalEntrySeparatorsLogFileOnlyMode = true, [CallerFilePath] string callerFilePath = "", [CallerLineNumber] int callerLineNumber = -1)
{
try

Create a public Log function in Logger.