Rename Logger.Debug to Logger.LogDebug across codebase
Renamed the Logger.Debug method to Logger.LogDebug for improved clarity and consistency. Updated all usages in PDFBurner, ReportCreator, FinalizeDocumentJob, TempFiles, and Logging.cs. No changes to logging logic or other log levels.
This commit is contained in:
@@ -57,43 +57,43 @@ public class FinalizeDocumentJob(IOptions<WorkerOptions> options, IConfiguration
|
||||
_tempFiles = new TempFiles(_logConfig);
|
||||
_tempFiles.Create();
|
||||
var jobId = typeof(FinalizeDocumentJob).FullName;
|
||||
_logger.Debug("Starting job {0}", jobId);
|
||||
_logger.LogDebug("Starting job {0}", jobId);
|
||||
|
||||
try
|
||||
{
|
||||
_logger.Debug("Loading GdViewer..");
|
||||
_logger.LogDebug("Loading GdViewer..");
|
||||
_gdViewer = new GdViewer();
|
||||
_licenseManager.RegisterKEY(gdPictureKey);
|
||||
|
||||
_logger.Debug("Loading Database..");
|
||||
_logger.LogDebug("Loading Database..");
|
||||
var connectionString = config.GetConnectionString("Default") ?? throw new InvalidOperationException("Connection string 'Default' not found.");
|
||||
_databaseConnectionString = MSSQLServer.DecryptConnectionString(connectionString);
|
||||
_database = new MSSQLServer(_logConfig, _databaseConnectionString);
|
||||
|
||||
_logger.Debug("Loading Models & Services");
|
||||
_logger.LogDebug("Loading Models & Services");
|
||||
var state = GetState();
|
||||
InitializeModels(state);
|
||||
|
||||
_logger.Debug("Loading Configuration..");
|
||||
_logger.LogDebug("Loading Configuration..");
|
||||
_config = _configModel?.LoadConfiguration() ?? new DbConfig();
|
||||
state.DbConfig = _config;
|
||||
|
||||
InitializeServices(state);
|
||||
|
||||
_logger.Debug("Loading PDFBurner..");
|
||||
_logger.LogDebug("Loading PDFBurner..");
|
||||
var pdfBurnerParams = _options.PdfBurner;
|
||||
_pdfBurner = new PDFBurner(_logConfig, gdPictureKey, pdfBurnerParams, _databaseConnectionString);
|
||||
|
||||
_logger.Debug("Loading PDFMerger..");
|
||||
_logger.LogDebug("Loading PDFMerger..");
|
||||
_pdfMerger = new PDFMerger(_logConfig, gdPictureKey);
|
||||
|
||||
_logger.Debug("Loading ReportCreator..");
|
||||
_logger.LogDebug("Loading ReportCreator..");
|
||||
_reportCreator = new ReportCreator(_logConfig, state);
|
||||
|
||||
_config.DocumentPath = _config.DocumentPath;
|
||||
|
||||
_logger.Debug("DocumentPath: [{0}]", _config.DocumentPath);
|
||||
_logger.Debug("ExportPath: [{0}]", _config.ExportPath);
|
||||
_logger.LogDebug("DocumentPath: [{0}]", _config.DocumentPath);
|
||||
_logger.LogDebug("ExportPath: [{0}]", _config.ExportPath);
|
||||
|
||||
var completeStatus = EnvelopeStatus.EnvelopeCompletelySigned;
|
||||
var sql = $"SELECT * FROM TBSIG_ENVELOPE WHERE STATUS = {completeStatus} AND DATEDIFF(minute, CHANGED_WHEN, GETDATE()) >= {CompleteWaitTime} ORDER BY GUID";
|
||||
@@ -123,7 +123,7 @@ public class FinalizeDocumentJob(IOptions<WorkerOptions> options, IConfiguration
|
||||
throw new ArgumentNullException(nameof(EnvelopeData));
|
||||
}
|
||||
|
||||
_logger.Debug("Loading Envelope Data..");
|
||||
_logger.LogDebug("Loading Envelope Data..");
|
||||
var envelopeData = GetEnvelopeData(id);
|
||||
|
||||
if (envelopeData is null)
|
||||
@@ -132,7 +132,7 @@ public class FinalizeDocumentJob(IOptions<WorkerOptions> options, IConfiguration
|
||||
throw new ArgumentNullException(nameof(EnvelopeData));
|
||||
}
|
||||
|
||||
_logger.Debug("Burning Annotations to pdf ...");
|
||||
_logger.LogDebug("Burning Annotations to pdf ...");
|
||||
var burnedDocument = BurnAnnotationsToPdf(envelopeData);
|
||||
if (burnedDocument is null)
|
||||
{
|
||||
@@ -146,24 +146,24 @@ public class FinalizeDocumentJob(IOptions<WorkerOptions> options, IConfiguration
|
||||
throw new ApplicationException("Document Report could not be created");
|
||||
}
|
||||
|
||||
_logger.Debug("Creating report..");
|
||||
_logger.LogDebug("Creating report..");
|
||||
var report = _reportCreator!.CreateReport(envelope);
|
||||
_logger.Debug("Report created!");
|
||||
_logger.LogDebug("Report created!");
|
||||
|
||||
_logger.Debug("Merging documents ...");
|
||||
_logger.LogDebug("Merging documents ...");
|
||||
var mergedDocument = _pdfMerger!.MergeDocuments(burnedDocument, report);
|
||||
_logger.Debug("Documents merged!");
|
||||
_logger.LogDebug("Documents merged!");
|
||||
|
||||
var outputDirectoryPath = Path.Combine(_config.ExportPath, _parentFolderUid);
|
||||
_logger.Debug("oOutputDirectoryPath is {0}", outputDirectoryPath);
|
||||
_logger.LogDebug("oOutputDirectoryPath is {0}", outputDirectoryPath);
|
||||
if (!Directory.Exists(outputDirectoryPath))
|
||||
{
|
||||
_logger.Debug("Directory not existing. Creating ... ");
|
||||
_logger.LogDebug("Directory not existing. Creating ... ");
|
||||
Directory.CreateDirectory(outputDirectoryPath);
|
||||
}
|
||||
|
||||
var outputFilePath = Path.Combine(outputDirectoryPath, $"{envelope.Uuid}.pdf");
|
||||
_logger.Debug("Writing finalized Pdf to disk..");
|
||||
_logger.LogDebug("Writing finalized Pdf to disk..");
|
||||
_logger.Info("Output path is [{0}]", outputFilePath);
|
||||
|
||||
try
|
||||
@@ -176,7 +176,7 @@ public class FinalizeDocumentJob(IOptions<WorkerOptions> options, IConfiguration
|
||||
throw new ExportDocumentException("Could not export final document to disk!", ex);
|
||||
}
|
||||
|
||||
_logger.Debug("Writing EB-bytes to database...");
|
||||
_logger.LogDebug("Writing EB-bytes to database...");
|
||||
UpdateFileDb(outputFilePath, envelope.Id);
|
||||
|
||||
if (!SendFinalEmails(envelope))
|
||||
@@ -186,7 +186,7 @@ public class FinalizeDocumentJob(IOptions<WorkerOptions> options, IConfiguration
|
||||
|
||||
_logger.Info("Report-mails successfully sent!");
|
||||
|
||||
_logger.Debug("Setting envelope status..");
|
||||
_logger.LogDebug("Setting envelope status..");
|
||||
if (_actionService?.FinalizeEnvelope(envelope) == false)
|
||||
{
|
||||
_logger.Warn("Envelope could not be finalized!");
|
||||
@@ -203,7 +203,7 @@ public class FinalizeDocumentJob(IOptions<WorkerOptions> options, IConfiguration
|
||||
_logger.Info("Envelope [{0}] finalized!", id);
|
||||
}
|
||||
|
||||
_logger.Debug("Completed job {0} successfully!", jobId);
|
||||
_logger.LogDebug("Completed job {0} successfully!", jobId);
|
||||
}
|
||||
catch (MergeDocumentException ex)
|
||||
{
|
||||
@@ -222,7 +222,7 @@ public class FinalizeDocumentJob(IOptions<WorkerOptions> options, IConfiguration
|
||||
}
|
||||
finally
|
||||
{
|
||||
_logger.Debug("Job execution for [{0}] ended", jobId);
|
||||
_logger.LogDebug("Job execution for [{0}] ended", jobId);
|
||||
}
|
||||
|
||||
return Task.FromResult(true);
|
||||
@@ -265,7 +265,7 @@ public class FinalizeDocumentJob(IOptions<WorkerOptions> options, IConfiguration
|
||||
|
||||
if (mailToCreator != FinalEmailType.No)
|
||||
{
|
||||
_logger?.Debug("Sending email to creator ...");
|
||||
_logger?.LogDebug("Sending email to creator ...");
|
||||
SendFinalEmailToCreator(envelope, mailToCreator);
|
||||
}
|
||||
else
|
||||
@@ -275,7 +275,7 @@ public class FinalizeDocumentJob(IOptions<WorkerOptions> options, IConfiguration
|
||||
|
||||
if (mailToReceivers != FinalEmailType.No)
|
||||
{
|
||||
_logger?.Debug("Sending emails to receivers..");
|
||||
_logger?.LogDebug("Sending emails to receivers..");
|
||||
SendFinalEmailToReceivers(envelope, mailToReceivers);
|
||||
}
|
||||
else
|
||||
@@ -289,7 +289,7 @@ public class FinalizeDocumentJob(IOptions<WorkerOptions> options, IConfiguration
|
||||
private bool SendFinalEmailToCreator(Envelope envelope, FinalEmailType mailToCreator)
|
||||
{
|
||||
var includeAttachment = SendFinalEmailWithAttachment(mailToCreator);
|
||||
_logger?.Debug("Attachment included: [{0}]", includeAttachment);
|
||||
_logger?.LogDebug("Attachment included: [{0}]", includeAttachment);
|
||||
|
||||
if (_actionService?.CompleteEnvelope(envelope) == false)
|
||||
{
|
||||
@@ -303,7 +303,7 @@ public class FinalizeDocumentJob(IOptions<WorkerOptions> options, IConfiguration
|
||||
private bool SendFinalEmailToReceivers(Envelope envelope, FinalEmailType mailToReceivers)
|
||||
{
|
||||
var includeAttachment = SendFinalEmailWithAttachment(mailToReceivers);
|
||||
_logger?.Debug("Attachment included: [{0}]", includeAttachment);
|
||||
_logger?.LogDebug("Attachment included: [{0}]", includeAttachment);
|
||||
|
||||
foreach (var receiver in envelope.EnvelopeReceivers ?? Enumerable.Empty<EnvelopeReceiver>())
|
||||
{
|
||||
@@ -336,9 +336,9 @@ public class FinalizeDocumentJob(IOptions<WorkerOptions> options, IConfiguration
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger?.Debug("we got bytes..");
|
||||
_logger?.LogDebug("we got bytes..");
|
||||
inputPath = _config!.DocumentPathOrigin;
|
||||
_logger?.Debug("oInputPath: {0}", _config.DocumentPathOrigin);
|
||||
_logger?.LogDebug("oInputPath: {0}", _config.DocumentPathOrigin);
|
||||
}
|
||||
|
||||
if (envelopeData.DocAsByte is null)
|
||||
@@ -393,7 +393,7 @@ public class FinalizeDocumentJob(IOptions<WorkerOptions> options, IConfiguration
|
||||
EnvelopeUuid = row.ItemEx("ENVELOPE_UUID", string.Empty)
|
||||
};
|
||||
|
||||
_logger?.Debug("Document path: [{0}]", data.DocumentPath);
|
||||
_logger?.LogDebug("Document path: [{0}]", data.DocumentPath);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user