Skip to content

Commit

Permalink
fix: enable profiling after logging setup (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmed-mez committed Dec 6, 2021
1 parent f98add8 commit 7e748e7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ func main() {
exitCode := 0
defer func() { os.Exit(exitCode) }()

// Logging setup
if err := customSetupLogging(*logLevel, logEncoder); err != nil {
setupLog.Error(err, "unable to setup the logger")
exitCode = 1

return
}

if ddProfilingEnabled {
setupLog.Info("Starting datadog profiler")
if err := profiler.Start(
Expand All @@ -88,14 +96,6 @@ func main() {
defer profiler.Stop()
}

// Logging setup
if err := customSetupLogging(*logLevel, logEncoder); err != nil {
setupLog.Error(err, "unable to setup the logger")
exitCode = 1

return
}

// Print version information
if printVersion {
version.PrintVersionWriter(os.Stdout)
Expand Down

0 comments on commit 7e748e7

Please sign in to comment.