feat: stdout access logger and MultiWriter

This commit is contained in:
yusing
2025-04-14 07:15:15 +08:00
parent dc1102905b
commit 82e2705f44
13 changed files with 145 additions and 30 deletions

View File

@@ -7,7 +7,7 @@ import (
// BackScanner provides an interface to read a file backward line by line.
type BackScanner struct {
file AccessLogIO
file supportRotate
chunkSize int
offset int64
buffer []byte
@@ -18,7 +18,7 @@ type BackScanner struct {
// NewBackScanner creates a new Scanner to read the file backward.
// chunkSize determines the size of each read chunk from the end of the file.
func NewBackScanner(file AccessLogIO, chunkSize int) *BackScanner {
func NewBackScanner(file supportRotate, chunkSize int) *BackScanner {
size, err := file.Seek(0, io.SeekEnd)
if err != nil {
return &BackScanner{err: err}