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

@@ -8,8 +8,8 @@ import (
"time"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/yusing/go-proxy/internal/gperr"
"github.com/yusing/go-proxy/internal/logging"
maxmind "github.com/yusing/go-proxy/internal/maxmind/types"
"github.com/yusing/go-proxy/internal/task"
"github.com/yusing/go-proxy/internal/utils"
@@ -120,7 +120,7 @@ func NewAccessLoggerWithIO(parent task.Parent, writer WriterWithName, anyCfg Any
bufSize: MinBufferSize,
lineBufPool: synk.NewBytesPool(),
errRateLimiter: rate.NewLimiter(rate.Every(errRateLimit), errBurst),
logger: logging.With().Str("file", writer.Name()).Logger(),
logger: log.With().Str("file", writer.Name()).Logger(),
}
l.supportRotate = unwrap[supportRotate](writer)

View File

@@ -7,7 +7,7 @@ import (
"path/filepath"
"sync"
"github.com/yusing/go-proxy/internal/logging"
"github.com/rs/zerolog/log"
"github.com/yusing/go-proxy/internal/utils"
)
@@ -90,7 +90,7 @@ func (f *File) Close() error {
}
func (f *File) closeOnZero() {
defer logging.Debug().
defer log.Debug().
Str("path", f.path).
Msg("access log closed")