Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var LogCbHandler callbacks.Handler
Functions ¶
Types ¶
type DailyRollingWriter ¶
type DailyRollingWriter struct {
// contains filtered or unexported fields
}
DailyRollingWriter implements an io.Writer that writes to log files named by day (YYYY-MM-DD). It automatically rotates the file when the day changes.
func NewDailyRollingWriter ¶
func NewDailyRollingWriter(dir, prefix string, maxSizeBytes int64) *DailyRollingWriter
NewDailyRollingWriter creates a new writer under dir with file name prefix. Files will be created as: <dir>/<prefix>-YYYY-MM-DD.log If maxSizeBytes > 0, a size-based rotation is enabled: when exceeding max size, a new file will be created with a time suffix: <prefix>-YYYY-MM-DD-HHMMSS.log
func (*DailyRollingWriter) Close ¶
func (w *DailyRollingWriter) Close() error
Close closes the current file if open.
Click to show internal directories.
Click to hide internal directories.