From b73c0380003a12d0c6c7e422152c806d6eb6d07d Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 5 Nov 2022 00:05:39 +0100 Subject: [PATCH] registry: configureLogging() simplify logic a bit Signed-off-by: Sebastiaan van Stijn --- registry/registry.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/registry/registry.go b/registry/registry.go index e2e35d58a..c6f33e1a0 100644 --- a/registry/registry.go +++ b/registry/registry.go @@ -367,16 +367,10 @@ func configureLogging(ctx context.Context, config *configuration.Configuration) Formatter: &logrus.JSONFormatter{TimestampFormat: time.RFC3339Nano}, }) default: - // just let the library use default on empty string. - if config.Log.Formatter != "" { - return ctx, fmt.Errorf("unsupported logging formatter: %q", config.Log.Formatter) - } - } - - if config.Log.Formatter != "" { - logrus.Debugf("using %q logging formatter", config.Log.Formatter) + return ctx, fmt.Errorf("unsupported logging formatter: %q", formatter) } + logrus.Debugf("using %q logging formatter", formatter) if len(config.Log.Fields) > 0 { // build up the static fields, if present. var fields []interface{}