diff --git a/internal/config/config.go b/internal/config/config.go index 118e6e7e..5cff27fd 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2021 Doc.ai and/or its affiliates. +// Copyright (c) 2020-2022 Doc.ai and/or its affiliates. // // SPDX-License-Identifier: Apache-2.0 // diff --git a/main.go b/main.go index fab4e789..93c98911 100644 --- a/main.go +++ b/main.go @@ -72,9 +72,16 @@ func main() { logger.Fatalf("error processing cfg from env: %+v", err) } - // ******************************************************************************** + logger.Infof("Using configuration: %v", cfg) + + level, err := logrus.ParseLevel(cfg.LogLevel) + if err != nil { + logger.Fatalf("invalid log level %s", cfg.LogLevel) + } + logrus.SetLevel(level) + sFinish() + // Configure Open Telemetry - // ******************************************************************************** if opentelemetry.IsEnabled() { collectorAddress := cfg.OpenTelemetryCollectorURL spanExporter := opentelemetry.InitSpanExporter(ctx, collectorAddress) @@ -87,15 +94,6 @@ func main() { }() } - logger.Infof("Using configuration: %v", cfg) - - level, err := logrus.ParseLevel(cfg.LogLevel) - if err != nil { - logger.Fatalf("invalid log level %s", cfg.LogLevel) - } - logrus.SetLevel(level) - sFinish() - err = manager.RunNsmgr(ctx, cfg) if err != nil { logger.Fatalf("error executing rootCmd: %v", err)