build: separate sublogger and rotator pipe management

These are two separate concerns. So this commit splits them up and just
passes a LogWriter from the one to the other. This will become cleaner
in an upcoming commit where the Rotator will implement io.Writer and
there will no longer be a need for LogWriter.
This commit is contained in:
Elle Mouton committed 2024-10-22 15:19:58 +02:00
1 parent ec5b39c120
commit 387a1a8831
6 files changed
+169 -107

No files matched your search

+1 -1
View File
@@ -149,7 +149,7 @@ func Main(cfg *Config, lisCfg ListenerCfg, implCfg *ImplementationCfg,
defer func() {
ltndLog.Info("Shutdown complete\n")
err := cfg.LogWriter.Close()
err := cfg.LogRotator.Close()
if err != nil {
ltndLog.Errorf("Could not close log rotator: %v", err)
}