common: fix unclosed logrus logging pipes
This commit is contained in:
parent
0c325137cf
commit
1cde7e341b
4 changed files with 67 additions and 36 deletions
|
|
@ -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})
|
||||
|
|
|
|||
|
|
@ -190,11 +190,13 @@ var run = func() {
|
|||
}
|
||||
|
||||
logrus.Info("Composer configuration:")
|
||||
encoder := toml.NewEncoder(logrus.StandardLogger().WriterLevel(logrus.InfoLevel))
|
||||
configWriter := logrus.StandardLogger().WriterLevel(logrus.DebugLevel)
|
||||
encoder := toml.NewEncoder(configWriter)
|
||||
err = encoder.Encode(&config)
|
||||
if err != nil {
|
||||
logrus.Fatalf("Could not print config: %v", err)
|
||||
}
|
||||
configWriter.Close()
|
||||
|
||||
if config.DeploymentChannel != "" {
|
||||
logrus.AddHook(&slogger.EnvironmentHook{Channel: config.DeploymentChannel})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue