Add logging of download license in DebugInfo

This commit is contained in:
Michael Bucari-Tovo 2021-07-24 11:28:58 -06:00
parent 61d7f5a5cb
commit fa66a361dc

View File

@ -2,6 +2,7 @@
using Dinah.Core; using Dinah.Core;
using Dinah.Core.Diagnostics; using Dinah.Core.Diagnostics;
using Dinah.Core.IO; using Dinah.Core.IO;
using Dinah.Core.Logging;
using Dinah.Core.StepRunner; using Dinah.Core.StepRunner;
using System; using System;
using System.IO; using System.IO;
@ -39,6 +40,7 @@ namespace AaxDecrypter
ArgumentValidator.EnsureNotNullOrWhiteSpace(outFileName, nameof(outFileName)); ArgumentValidator.EnsureNotNullOrWhiteSpace(outFileName, nameof(outFileName));
OutputFileName = outFileName; OutputFileName = outFileName;
var outDir = Path.GetDirectoryName(OutputFileName); var outDir = Path.GetDirectoryName(OutputFileName);
if (!Directory.Exists(outDir)) if (!Directory.Exists(outDir))
throw new ArgumentNullException(nameof(outDir), "Directory does not exist"); throw new ArgumentNullException(nameof(outDir), "Directory does not exist");
if (File.Exists(OutputFileName)) if (File.Exists(OutputFileName))
@ -51,6 +53,11 @@ namespace AaxDecrypter
downloadLicense = ArgumentValidator.EnsureNotNull(dlLic, nameof(dlLic)); downloadLicense = ArgumentValidator.EnsureNotNull(dlLic, nameof(dlLic));
OutputFormat = outputFormat; OutputFormat = outputFormat;
if (Serilog.Log.Logger.IsDebugEnabled())
{
Serilog.Log.Logger.Debug("Request/Response details. {@DebugInfo}", downloadLicense);
}
steps = new StepSequence steps = new StepSequence
{ {
Name = "Download and Convert Aaxc To " + (outputFormat == OutputFormat.Mp4a ? "M4b" : "Mp3"), Name = "Download and Convert Aaxc To " + (outputFormat == OutputFormat.Mp4a ? "M4b" : "Mp3"),