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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ public class FinalizeDocumentJob(IOptions<WorkerOptions> 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<WorkerOptions> 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<WorkerOptions> 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<WorkerOptions> 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<WorkerOptions> 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<WorkerOptions> 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<WorkerOptions> 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<WorkerOptions> 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;
|
||||
|
||||
@@ -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<object?>());
|
||||
public void Error(Exception exception, string message, params object?[] args) => Write("ERROR", message + " " + exception.Message, args);
|
||||
|
||||
Reference in New Issue
Block a user