refactor: remove the use of logging module in most code

This commit is contained in:
yusing
2025-05-23 23:28:33 +08:00
parent 20a1649275
commit 63c4bdc73d
51 changed files with 194 additions and 203 deletions

View File

@@ -4,8 +4,8 @@ import (
"os"
"github.com/rs/zerolog"
zerologlog "github.com/rs/zerolog/log"
"github.com/yusing/go-proxy/internal/common"
"github.com/yusing/go-proxy/internal/logging"
)
func log(msg string, err error, level zerolog.Level, logger ...*zerolog.Logger) {
@@ -13,7 +13,7 @@ func log(msg string, err error, level zerolog.Level, logger ...*zerolog.Logger)
if len(logger) > 0 {
l = logger[0]
} else {
l = logging.GetLogger()
l = &zerologlog.Logger
}
l.WithLevel(level).Msg(New(highlightANSI(msg)).With(err).Error())
switch level {