MCPcopy
hub / github.com/andeya/pholcus / FileLogWriter

Struct FileLogWriter

logs/logs/file.go:41–64  ·  view source on GitHub ↗

FileLogWriter implements LoggerInterface. It writes messages by lines limit, file size limit, or time frequency.

Source from the content-addressed store, hash-verified

39// FileLogWriter implements LoggerInterface.
40// It writes messages by lines limit, file size limit, or time frequency.
41type FileLogWriter struct {
42 *log.Logger
43 mw *MuxWriter
44 // The opened file
45 Filename string `json:"filename"`
46
47 Maxlines int `json:"maxlines"`
48 maxlines_curlines int
49
50 // Rotate at size
51 Maxsize int `json:"maxsize"`
52 maxsize_cursize int
53
54 // Rotate daily
55 Daily bool `json:"daily"`
56 Maxdays int64 `json:"maxdays"`
57 daily_opendate int
58
59 Rotate bool `json:"rotate"`
60
61 startLock sync.Mutex // Only one log can write to the file
62
63 Level int `json:"level"`
64}
65
66// an *os.File writer with locker.
67type MuxWriter struct {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected