From 50c90ce85eb38e12e837e09fd5222ebdc21021d9 Mon Sep 17 00:00:00 2001 From: denis-tingaikin Date: Tue, 1 Oct 2024 16:07:22 +0300 Subject: [PATCH] add usage of SetupLevelChangeOnSignal Signed-off-by: denis-tingaikin --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.go b/main.go index c4f5c74..d889f75 100644 --- a/main.go +++ b/main.go @@ -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