log

package
v0.2.15 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = New(WithLevel(-1))

Functions

func Debug

func Debug(args ...any)

func Debugf

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

func Debugln

func Debugln(args ...any)

func Error

func Error(args ...any)

func Errorf

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

func Errorln

func Errorln(args ...any)

func Fatal

func Fatal(args ...any)

func Fatalf

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

func Fatalln

func Fatalln(args ...any)

func Info

func Info(args ...any)

func Infof

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

func Infoln

func Infoln(args ...any)

func Level

func Level() zapcore.Level

func Sugared

func Sugared() *zap.SugaredLogger

func Warn

func Warn(args ...any)

func Warnf

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

func Warnln

func Warnln(args ...any)

Types

type Logger

type Logger interface {
	Sugared() *zap.SugaredLogger
	Level() zapcore.Level

	Debug(args ...any)
	Info(args ...any)
	Warn(args ...any)
	Error(args ...any)
	Fatal(args ...any)
	Debugln(args ...any)
	Infoln(args ...any)
	Warnln(args ...any)
	Errorln(args ...any)
	Fatalln(args ...any)
	Debugf(template string, args ...any)
	Infof(template string, args ...any)
	Warnf(template string, args ...any)
	Errorf(template string, args ...any)
	Fatalf(template string, args ...any)

	With(args ...any) Logger
	By(caller common.Named) Logger
}

func By added in v0.0.3

func By(caller common.Named) Logger

func New

func New(opts ...Option) Logger

func With

func With(args ...any) Logger

type Option

type Option func(*logger)

func WithFileWriter

func WithFileWriter(file string, maxSize, maxBackups, maxAge int) Option

func WithLevel

func WithLevel(level int) Option

func WithTimeFormat added in v0.1.11

func WithTimeFormat(format string) Option

Jump to

Keyboard shortcuts

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