fix: Move detailed CF output to debug logs

json-serializing-nullable-fields-issue
Robert Dailey 8 months ago
parent 159861aaeb
commit 1aaa2747b8

@ -20,6 +20,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Less-verbose console logging for scoreless custom formats.
- Git repository updates are now parallelized.
- Individual updated, created, and deleted CF logs are now debug severity. This makes the console
output less verbose when syncing custom formats.
### Fixed

@ -1,16 +1,12 @@
using Spectre.Console;
namespace Recyclarr.Cli.Pipelines.CustomFormat.PipelinePhases;
public class CustomFormatPreviewPhase
{
private readonly ILogger _log;
private readonly IAnsiConsole _console;
public CustomFormatPreviewPhase(ILogger log, IAnsiConsole console)
public CustomFormatPreviewPhase(ILogger log)
{
_log = log;
_console = console;
}
public void Execute(CustomFormatTransactionData transactions)
@ -28,11 +24,10 @@ public class CustomFormatPreviewPhase
if (created.Count > 0)
{
_log.Information("Created {Count} New Custom Formats", created.Count);
_log.Debug("Custom formats Created: {CustomFormats}", created.Select(x => x.Name));
foreach (var cf in created)
{
_console.WriteLine($"> Created: {cf.TrashId} ({cf.Name})");
_log.Debug("> Created: {TrashId} ({Name})", cf.TrashId, cf.Name);
}
}
@ -40,12 +35,10 @@ public class CustomFormatPreviewPhase
if (updated.Count > 0)
{
_log.Information("Updated {Count} Existing Custom Formats", updated.Count);
_log.Debug("Custom formats Updated: {CustomFormats}",
updated.ToDictionary(k => k.TrashId, v => v.Name));
foreach (var cf in updated)
{
_console.WriteLine($"> Updated: {cf.TrashId} ({cf.Name})");
_log.Debug("> Updated: {TrashId} ({Name})", cf.TrashId, cf.Name);
}
}
@ -63,12 +56,10 @@ public class CustomFormatPreviewPhase
if (deleted.Count > 0)
{
_log.Information("Deleted {Count} Custom Formats", deleted.Count);
_log.Debug("Custom formats Deleted: {CustomFormats}",
deleted.ToDictionary(k => k.TrashId, v => v.CustomFormatName));
foreach (var mapping in deleted)
{
_console.WriteLine($"> Deleted: {mapping.TrashId} ({mapping.CustomFormatName})");
_log.Debug("> Deleted: {TrashId} ({CustomFormatName})", mapping.TrashId, mapping.CustomFormatName);
}
}

Loading…
Cancel
Save