common: fix unclosed logrus logging pipes

This commit is contained in:
Lukas Zapletal 2025-05-22 13:44:42 +02:00 committed by Lukáš Zapletal
parent 0c325137cf
commit 1cde7e341b
4 changed files with 67 additions and 36 deletions

View file

@ -80,10 +80,12 @@ func main() {
}
logrus.Info("Loaded configuration:")
err = DumpConfig(*config, logrus.StandardLogger().WriterLevel(logrus.InfoLevel))
dumpWriter := logrus.StandardLogger().WriterLevel(logrus.DebugLevel)
err = DumpConfig(*config, dumpWriter)
if err != nil {
logrus.Fatalf("Error printing configuration: %v", err)
}
dumpWriter.Close()
if config.DeploymentChannel != "" {
logrus.AddHook(&slogger.EnvironmentHook{Channel: config.DeploymentChannel})