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 <denis.tingajkin@xored.com>
  • Loading branch information
denis-tingaikin committed Oct 1, 2024
1 parent 5868cc1 commit abd0fc9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,6 @@ issues:
- path: internal/vppinit/vppinit.go
linters:
- gocyclo
- path: main.go
linters:
- gocyclo
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ func main() {
logrus.Fatalf("invalid log level %s", cfg.LogLevel)
}
logrus.SetLevel(level)
if level == logrus.TraceLevel {
logruslogger.SetupLevelChangeOnSignal(ctx, map[os.Signal]logrus.Level{
syscall.SIGUSR1: logrus.TraceLevel,
syscall.SIGUSR2: level,
})
}
log.EnableTracing(true)
log.FromContext(ctx).WithField("duration", time.Since(now)).Infof("completed phase 1: get config from environment")

Expand Down

0 comments on commit abd0fc9

Please sign in to comment.