all: eliminate usage of global ProxyLogger

So setting up logging for ctrld binary and ctrld packages could be done
more easily, decouple the required setup for interactive vs daemon
running.

This is the first step toward replacing rs/zerolog libary with a
different logging library.
This commit is contained in:
Cuong Manh Le
2025-04-03 21:17:02 +07:00
committed by Cuong Manh Le
parent 47c04bf0f6
commit 0e66697247
39 changed files with 425 additions and 420 deletions
+1 -2
View File
@@ -137,8 +137,7 @@ func (p *prog) initInternalLogging(writers []io.Writer) {
})
multi := zerolog.MultiLevelWriter(writers...)
l := mainLog.Load().Output(multi).With().Logger()
mainLog.Store(&l)
ctrld.ProxyLogger.Store(&l)
mainLog.Store(&ctrld.Logger{Logger: &l})
}
// needInternalLogging reports whether prog needs to run internal logging.