init, eod commit
This commit is contained in:
27
util/logger/structs.go
Normal file
27
util/logger/structs.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package logger
|
||||
|
||||
import (
|
||||
"io"
|
||||
"log/slog"
|
||||
"os"
|
||||
"sync"
|
||||
)
|
||||
|
||||
type fileRouter struct {
|
||||
mu sync.RWMutex
|
||||
handlers map[string]slog.Handler // map[filePath]handler
|
||||
files map[string]*os.File // map[filePath]*os.File to close later
|
||||
baseDir string
|
||||
rotationDays int
|
||||
id string
|
||||
dirTimeLayout string // "2006-01-02" - daily dirs
|
||||
}
|
||||
|
||||
// prefixWriter - writes a prefix at the start of each new line.
|
||||
// It is safe for concurrent use.
|
||||
type prefixWriter struct {
|
||||
inner io.Writer
|
||||
prefix []byte
|
||||
mu sync.Mutex
|
||||
startLine bool
|
||||
}
|
||||
Reference in New Issue
Block a user