init, eod commit

This commit is contained in:
2025-11-30 22:00:47 +01:00
parent 76a288de8b
commit 675e114278
9 changed files with 340 additions and 16 deletions

27
util/logger/structs.go Normal file
View 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
}