Documentation
¶
Overview ¶
Package logger provides the plugin's structured logging and rotating log files.
Index ¶
- func Debugf(format string, args ...any)
- func Errorf(format string, args ...any)
- func Get() *slog.Logger
- func Infof(format string, args ...any)
- func Init(logPath string) error
- func SetLevel(l slog.Level)
- func SetOutput(w io.Writer)
- func Warnf(format string, args ...any)
- func With(args ...any) *slog.Logger
- type RotatingFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
Init logs to the file at logPath as well as to stdout. If the file cannot be opened, logging stays on stdout and Init returns the error.
Types ¶
type RotatingFile ¶
type RotatingFile struct {
// contains filtered or unexported fields
}
RotatingFile is an append-only log file that is renamed to <path>.1 once it would grow past maxBytes, so a log never takes more than twice that on disk.
func OpenRotating ¶
func OpenRotating(path string, maxBytes int64) (*RotatingFile, error)
OpenRotating opens or creates the log file at path.
Click to show internal directories.
Click to hide internal directories.