From 5230076d5d7e7a66f4ccd51aaced0f8eb3b3e75a Mon Sep 17 00:00:00 2001 From: TekH Date: Wed, 25 Feb 2026 13:37:50 +0100 Subject: [PATCH] Rename Logger.Warn to Logger.LogWarning throughout codebase Replaces all usages of Logger.Warn with Logger.LogWarning for consistency with .NET logging conventions. Updates the Logger class method name and all related calls, with no changes to logic or parameters. --- .../Jobs/FinalizeDocument/PDFBurner.cs | 4 ++-- .../Jobs/FinalizeDocumentJob.cs | 22 +++++++++---------- .../Jobs/Infrastructure/Logging.cs | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/EnvelopeGenerator.ServiceHost/Jobs/FinalizeDocument/PDFBurner.cs b/EnvelopeGenerator.ServiceHost/Jobs/FinalizeDocument/PDFBurner.cs index 2a76e4af..a9cc99a3 100644 --- a/EnvelopeGenerator.ServiceHost/Jobs/FinalizeDocument/PDFBurner.cs +++ b/EnvelopeGenerator.ServiceHost/Jobs/FinalizeDocument/PDFBurner.cs @@ -149,8 +149,8 @@ public class PDFBurner : BaseClass } catch (Exception ex) { - Logger.Warn("Error in AddInstantJSONAnnotationToPDF - oJson: "); - Logger.Warn(json); + Logger.LogWarning("Error in AddInstantJSONAnnotationToPDF - oJson: "); + Logger.LogWarning(json); throw new BurnAnnotationException("Adding Annotation failed", ex); } } diff --git a/EnvelopeGenerator.ServiceHost/Jobs/FinalizeDocumentJob.cs b/EnvelopeGenerator.ServiceHost/Jobs/FinalizeDocumentJob.cs index 8e731b77..77b5af61 100644 --- a/EnvelopeGenerator.ServiceHost/Jobs/FinalizeDocumentJob.cs +++ b/EnvelopeGenerator.ServiceHost/Jobs/FinalizeDocumentJob.cs @@ -119,7 +119,7 @@ public class FinalizeDocumentJob(IOptions options, IConfiguration var envelope = _envelopeModel?.GetById(id); if (envelope is null) { - _logger.Warn("Envelope could not be loaded for Id [{0}]!", id); + _logger.LogWarning("Envelope could not be loaded for Id [{0}]!", id); throw new ArgumentNullException(nameof(EnvelopeData)); } @@ -128,7 +128,7 @@ public class FinalizeDocumentJob(IOptions options, IConfiguration if (envelopeData is null) { - _logger.Warn("EnvelopeData could not be loaded for Id [{0}]!", id); + _logger.LogWarning("EnvelopeData could not be loaded for Id [{0}]!", id); throw new ArgumentNullException(nameof(EnvelopeData)); } @@ -136,13 +136,13 @@ public class FinalizeDocumentJob(IOptions options, IConfiguration var burnedDocument = BurnAnnotationsToPdf(envelopeData); if (burnedDocument is null) { - _logger.Warn("Document could not be finalized!"); + _logger.LogWarning("Document could not be finalized!"); throw new ApplicationException("Document could not be finalized"); } if (_actionService?.CreateReport(envelope) == false) { - _logger.Warn("Document Report could not be created!"); + _logger.LogWarning("Document Report could not be created!"); throw new ApplicationException("Document Report could not be created"); } @@ -172,7 +172,7 @@ public class FinalizeDocumentJob(IOptions options, IConfiguration } catch (Exception ex) { - _logger.Warn("Could not export final document to disk!"); + _logger.LogWarning("Could not export final document to disk!"); throw new ExportDocumentException("Could not export final document to disk!", ex); } @@ -189,7 +189,7 @@ public class FinalizeDocumentJob(IOptions options, IConfiguration _logger.LogDebug("Setting envelope status.."); if (_actionService?.FinalizeEnvelope(envelope) == false) { - _logger.Warn("Envelope could not be finalized!"); + _logger.LogWarning("Envelope could not be finalized!"); throw new ApplicationException("Envelope could not be finalized"); } } @@ -207,17 +207,17 @@ public class FinalizeDocumentJob(IOptions options, IConfiguration } catch (MergeDocumentException ex) { - _logger.Warn("Certificate Document job failed at step: Merging documents!"); + _logger.LogWarning("Certificate Document job failed at step: Merging documents!"); _logger.Error(ex); } catch (ExportDocumentException ex) { - _logger.Warn("Certificate Document job failed at step: Exporting document!"); + _logger.LogWarning("Certificate Document job failed at step: Exporting document!"); _logger.Error(ex); } catch (Exception ex) { - _logger.Warn("Certificate Document job failed!"); + _logger.LogWarning("Certificate Document job failed!"); _logger.Error(ex); } finally @@ -270,7 +270,7 @@ public class FinalizeDocumentJob(IOptions options, IConfiguration } else { - _logger?.Warn("No SendFinalEmailToCreator - oMailToCreator [{0}] <> [{1}] ", mailToCreator, FinalEmailType.No); + _logger?.LogWarning("No SendFinalEmailToCreator - oMailToCreator [{0}] <> [{1}] ", mailToCreator, FinalEmailType.No); } if (mailToReceivers != FinalEmailType.No) @@ -280,7 +280,7 @@ public class FinalizeDocumentJob(IOptions options, IConfiguration } else { - _logger?.Warn("No SendFinalEmailToReceivers - oMailToCreator [{0}] <> [{1}] ", mailToReceivers, FinalEmailType.No); + _logger?.LogWarning("No SendFinalEmailToReceivers - oMailToCreator [{0}] <> [{1}] ", mailToReceivers, FinalEmailType.No); } return true; diff --git a/EnvelopeGenerator.ServiceHost/Jobs/Infrastructure/Logging.cs b/EnvelopeGenerator.ServiceHost/Jobs/Infrastructure/Logging.cs index c791869b..431114db 100644 --- a/EnvelopeGenerator.ServiceHost/Jobs/Infrastructure/Logging.cs +++ b/EnvelopeGenerator.ServiceHost/Jobs/Infrastructure/Logging.cs @@ -15,7 +15,7 @@ public class 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 Warn(string message, params object?[] args) => Write("WARN", 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 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);