Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>
  • Loading branch information
NikitaSkrynnik committed Jan 13, 2022
1 parent 18ffc8f commit ac7f7bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
@@ -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
//
Expand Down
20 changes: 9 additions & 11 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit ac7f7bc

Please sign in to comment.