From c1b3b1ddbd27bc341e2f0a47ce104f0cc2dc44b2 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Thu, 16 Dec 2021 15:07:24 -0700 Subject: [PATCH] Add more logging to validation --- Wabbajack.CLI/Verbs/ValidateLists.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Wabbajack.CLI/Verbs/ValidateLists.cs b/Wabbajack.CLI/Verbs/ValidateLists.cs index d69426df..0f22fba5 100644 --- a/Wabbajack.CLI/Verbs/ValidateLists.cs +++ b/Wabbajack.CLI/Verbs/ValidateLists.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.CommandLine; using System.CommandLine.Invocation; using System.Diagnostics; +using System.Drawing; using System.IO; using System.IO.Compression; using System.Linq; @@ -268,6 +269,7 @@ public class ValidateLists : IVerb await patchOutput.DisposeAsync(); await UploadPatchToCDN(patchFile.Path, $"{upgrade.Hash.ToHex()}_{archive.Hash.ToHex()}", token); + _logger.LogInformation("Upgraded {FromHash} to {ToHash}", archive.Hash, upgrade.Hash); return (ArchiveStatus.Updated, new ValidatedArchive { Original = archive, @@ -284,21 +286,23 @@ public class ValidateLists : IVerb try { _logger.Log(LogLevel.Information, - $"Uploading {patchFile.Size().ToFileSizeString()} patch file to CDN {patchName}"); + "Uploading {Size} patch file to CDN {Name}", patchFile.Size().ToFileSizeString(), patchName); using var client = await (await _ftpSiteCredentials.Get())[StorageSpace.Patches].GetClient(_logger); await client.UploadFileAsync(patchFile.ToString(), patchName, FtpRemoteExists.Overwrite, token: token); + _logger.Log(LogLevel.Information, + "Finished uploading {Size} patch file to CDN {Name}", patchFile.Size().ToFileSizeString(), patchName); return; } catch (Exception ex) { - _logger.LogError(ex, $"Error uploading {patchFile} to CDN"); + _logger.LogError(ex, "Error uploading {Name} to CDN", patchName); if (ex.InnerException != null) _logger.LogError(ex.InnerException, "Inner Exception"); } } - _logger.Log(LogLevel.Error, $"Couldn't upload {patchFile} to {patchName}"); + _logger.Log(LogLevel.Error, "Couldn't upload {File} to {Name}", patchFile, patchName); }