log

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg any, args ...any)

func Debugf

func Debugf(format string, args ...any)

func Error

func Error(msg any, args ...any)

func Errorf

func Errorf(format string, args ...any)

func Fatal

func Fatal(msg any, args ...any)

func Fatalf

func Fatalf(format string, args ...any)

func Info

func Info(msg any, args ...any)

func Infof

func Infof(format string, args ...any)

func SetDefault

func SetDefault(logger Logger)

func Warn

func Warn(msg any, args ...any)

func Warnf

func Warnf(format string, args ...any)

Types

type Config

type Config struct {
	Type         string // charm, zap
	LogFile      string
	Level        Level
	FileLevel    Level
	MaxSize      int
	MaxBackups   int
	MaxAge       int
	CallerOffset int
	Compress     bool
}

func (*Config) ApplyDefaults

func (c *Config) ApplyDefaults()

type Level

type Level uint
const (
	LevelDebug Level = iota
	LevelInfo
	LevelWarn
	LevelError
	LevelFatal
)

type Logger

type Logger interface {
	Debug(msg any, args ...any)
	Info(msg any, args ...any)
	Warn(msg any, args ...any)
	Error(msg any, args ...any)
	Fatal(msg any, args ...any)

	Debugf(format string, args ...any)
	Infof(format string, args ...any)
	Warnf(format string, args ...any)
	Errorf(format string, args ...any)
	Fatalf(format string, args ...any)
}

func CharmLog

func CharmLog(cfg Config) Logger

func Default

func Default() Logger

func New

func New(cfg Config) Logger

func ZapLog

func ZapLog(cfg Config) Logger

Jump to

Keyboard shortcuts

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