From 0ca372bf45801b4fcfd410132753c7fdca2f3ff5 Mon Sep 17 00:00:00 2001 From: TekH Date: Wed, 25 Feb 2026 13:38:55 +0100 Subject: [PATCH] Update logging methods to use standard naming conventions Replaced custom Warn method with LogWarning in Logger class and updated usage in FinalizeDocumentJob. Added LogInformation and LogWarning methods for consistency with common logging practices. LogWarning now accepts an Exception as the first parameter, aligning with standard logging signatures. --- EnvelopeGenerator.ServiceHost/Jobs/FinalizeDocumentJob.cs | 2 +- .../Jobs/Infrastructure/Logging.cs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/EnvelopeGenerator.ServiceHost/Jobs/FinalizeDocumentJob.cs b/EnvelopeGenerator.ServiceHost/Jobs/FinalizeDocumentJob.cs index 77b5af61..d0e6724c 100644 --- a/EnvelopeGenerator.ServiceHost/Jobs/FinalizeDocumentJob.cs +++ b/EnvelopeGenerator.ServiceHost/Jobs/FinalizeDocumentJob.cs @@ -196,7 +196,7 @@ public class FinalizeDocumentJob(IOptions options, IConfiguration catch (Exception ex) { _logger.Error(ex); - _logger.Warn(ex, "Unhandled exception while working envelope [{0}]", id); + _logger.LogWarning(ex, "Unhandled exception while working envelope [{0}]", id); } current += 1; diff --git a/EnvelopeGenerator.ServiceHost/Jobs/Infrastructure/Logging.cs b/EnvelopeGenerator.ServiceHost/Jobs/Infrastructure/Logging.cs index 431114db..b2828ba0 100644 --- a/EnvelopeGenerator.ServiceHost/Jobs/Infrastructure/Logging.cs +++ b/EnvelopeGenerator.ServiceHost/Jobs/Infrastructure/Logging.cs @@ -14,9 +14,13 @@ public class Logger ILogger logger; public void LogDebug(string message, params object?[] args) => Write("DEBUG", message, args); + public void LogInformation(string message, params object?[] args) => Write("INFO", message, args); + public void LogWarning(string message, params object?[] args) => Write("WARN", message, args); - public void Warn(Exception exception, string message, params object?[] args) => Write("WARN", message + " " + exception.Message, args); + + public void LogWarning(Exception exception, string message, params object?[] args) => Write("WARN", message + " " + exception.Message, args); + public void Error(Exception exception) => Write("ERROR", exception.Message, Array.Empty()); public void Error(Exception exception, string message, params object?[] args) => Write("ERROR", message + " " + exception.Message, args);