From 766208ba89038e580455d734f56b94b37ca101b1 Mon Sep 17 00:00:00 2001 From: Alex Boten <223565+codeboten@users.noreply.github.com> Date: Thu, 3 Oct 2024 15:52:11 -0700 Subject: [PATCH] lint Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com> --- service/telemetry/logger.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/service/telemetry/logger.go b/service/telemetry/logger.go index de4ce14fbdf..4e9bff24429 100644 --- a/service/telemetry/logger.go +++ b/service/telemetry/logger.go @@ -33,6 +33,10 @@ func newLogger(ctx context.Context, cfg LogsConfig, options []zap.Option) (*zap. logger, err := zapCfg.Build(options...) + if err != nil { + return nil, err + } + if len(cfg.Processors) > 0 { sdk, err := config.NewSDK( config.WithContext(ctx), @@ -53,9 +57,6 @@ func newLogger(ctx context.Context, cfg LogsConfig, options []zap.Option) (*zap. })) } - if err != nil { - return nil, err - } if cfg.Sampling != nil && cfg.Sampling.Enabled { logger = newSampledLogger(logger, cfg.Sampling) }