From 7a4740b79b392973997dd1f01cb1e9ebd854b8fe Mon Sep 17 00:00:00 2001 From: soup Date: Sat, 30 Dec 2023 02:35:03 +0100 Subject: [PATCH] feat: dynamic log type for sonarr/whisparr (#70) --- internal/processor/sonarr.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/processor/sonarr.go b/internal/processor/sonarr.go index 2878358..66e0938 100644 --- a/internal/processor/sonarr.go +++ b/internal/processor/sonarr.go @@ -16,7 +16,14 @@ import ( ) func (s Service) sonarr(ctx context.Context, cfg *domain.ArrConfig, dryRun bool, brr *autobrr.Client) error { - l := log.With().Str("type", "sonarr").Str("client", cfg.Name).Logger() + var arrType string + if cfg.Type == domain.ArrTypeWhisparr { + arrType = "whisparr" + } else { + arrType = "sonarr" + } + + l := log.With().Str("type", arrType).Str("client", cfg.Name).Logger() l.Debug().Msgf("gathering titles...")