refactor: Better pipeline execusion debug logs

pull/303/head
Robert Dailey 6 months ago
parent e2cff7d9fa
commit 94daa54996

@ -8,7 +8,7 @@ namespace Recyclarr.Cli.Pipelines.CustomFormat;
public class CustomFormatPipelineContext : IPipelineContext public class CustomFormatPipelineContext : IPipelineContext
{ {
public string PipelineDescription => "Custom Format Pipeline"; public string PipelineDescription => "Custom Format";
public IReadOnlyCollection<SupportedServices> SupportedServiceTypes { get; } = new[] public IReadOnlyCollection<SupportedServices> SupportedServiceTypes { get; } = new[]
{ {
SupportedServices.Sonarr, SupportedServices.Sonarr,

@ -13,10 +13,12 @@ public class GenericSyncPipeline<TContext>(
public async Task Execute(ISyncSettings settings, CancellationToken ct) public async Task Execute(ISyncSettings settings, CancellationToken ct)
{ {
var context = new TContext(); var context = new TContext();
log.Debug("Executing Pipeline: {Pipeline}", context.PipelineDescription);
if (!context.SupportedServiceTypes.Contains(config.ServiceType)) if (!context.SupportedServiceTypes.Contains(config.ServiceType))
{ {
log.Debug("Skipping {Description} because it does not support service type {Service}", log.Debug("Skipping this pipeline because it does not support service type {Service}", config.ServiceType);
context.PipelineDescription, config.ServiceType);
return; return;
} }

@ -7,7 +7,7 @@ namespace Recyclarr.Cli.Pipelines.MediaNaming;
public class MediaNamingPipelineContext : IPipelineContext public class MediaNamingPipelineContext : IPipelineContext
{ {
public string PipelineDescription => "Media Naming Pipeline"; public string PipelineDescription => "Media Naming";
public IReadOnlyCollection<SupportedServices> SupportedServiceTypes { get; } = new[] public IReadOnlyCollection<SupportedServices> SupportedServiceTypes { get; } = new[]
{ {
SupportedServices.Sonarr, SupportedServices.Sonarr,

@ -10,7 +10,7 @@ namespace Recyclarr.Cli.Pipelines.QualityProfile;
"Context objects are similar to DTOs; for usability we want to assign not append")] "Context objects are similar to DTOs; for usability we want to assign not append")]
public class QualityProfilePipelineContext : IPipelineContext public class QualityProfilePipelineContext : IPipelineContext
{ {
public string PipelineDescription => "Quality Definition Pipeline"; public string PipelineDescription => "Quality Definition";
public IReadOnlyCollection<SupportedServices> SupportedServiceTypes { get; } = new[] public IReadOnlyCollection<SupportedServices> SupportedServiceTypes { get; } = new[]
{ {
SupportedServices.Sonarr, SupportedServices.Sonarr,

@ -10,7 +10,7 @@ namespace Recyclarr.Cli.Pipelines.QualitySize;
"Context objects are similar to DTOs; for usability we want to assign not append")] "Context objects are similar to DTOs; for usability we want to assign not append")]
public class QualitySizePipelineContext : IPipelineContext public class QualitySizePipelineContext : IPipelineContext
{ {
public string PipelineDescription => "Quality Definition Pipeline"; public string PipelineDescription => "Quality Definition";
public IReadOnlyCollection<SupportedServices> SupportedServiceTypes { get; } = new[] public IReadOnlyCollection<SupportedServices> SupportedServiceTypes { get; } = new[]
{ {
SupportedServices.Sonarr, SupportedServices.Sonarr,

@ -27,7 +27,6 @@ public class SyncPipelineExecutor(
foreach (var pipeline in pipelines) foreach (var pipeline in pipelines)
{ {
log.Debug("Executing Pipeline: {Pipeline}", pipeline.GetType().Name);
await pipeline.Execute(settings, ct); await pipeline.Execute(settings, ct);
} }

Loading…
Cancel
Save