Skip to content

Commit

Permalink
add usage of SetupLevelChangeOnSignal
Browse files Browse the repository at this point in the history
Signed-off-by: denis-tingaikin <[email protected]>
  • Loading branch information
denis-tingaikin committed Oct 1, 2024
1 parent 5264aea commit 50c90ce
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ func main() {
logrus.Fatalf("invalid log level %s", config.LogLevel)
}
logrus.SetLevel(l)
if l != logrus.TraceLevel {
logruslogger.SetupLevelChangeOnSignal(ctx, map[os.Signal]logrus.Level{
syscall.SIGUSR1: logrus.TraceLevel,
syscall.SIGUSR2: l,
})
}
log.FromContext(ctx).Infof("Config: %#v", config)

// Configure Open Telemetry
Expand Down

0 comments on commit 50c90ce

Please sign in to comment.