refactor: clean up logger and metric initialization flow

This commit is contained in:
yusing
2025-03-29 02:55:26 +08:00
parent 366c89164f
commit 1c001ed9df
6 changed files with 27 additions and 32 deletions

View File

@@ -45,9 +45,9 @@ func fmtMessage(msg string) string {
return strutils.JoinRune(lines, '\n')
}
func InitLogger(out io.Writer) {
func InitLogger(out ...io.Writer) {
writer := zerolog.ConsoleWriter{
Out: out,
Out: zerolog.MultiLevelWriter(out...),
TimeFormat: timeFmt,
FormatMessage: func(msgI interface{}) string { // pad spaces for each line
return fmtMessage(msgI.(string))