callback

package
v0.0.0-...-ca21e7b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogCbHandler callbacks.Handler

Functions

func LogCallback

func LogCallback(config *LogCallbackConfig) callbacks.Handler

LogCallback 日志回调

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.

func (*DailyRollingWriter) Write

func (w *DailyRollingWriter) Write(p []byte) (int, error)

Write implements io.Writer and rotates the underlying file when day changes.

type LogCallbackConfig

type LogCallbackConfig struct {
	Detail bool
	Debug  bool
	Writer io.Writer
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL