logger

package
v0.0.0-...-8403503 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...any)

func Debugf

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

func Error

func Error(args ...any)

func Errorf

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

func Errorw

func Errorw(template string, keysAndValues ...any)

func Fatal

func Fatal(args ...any)

func Fatalf

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

func Fatalw

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

func Info

func Info(args ...any)

func Infof

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

func Infow

func Infow(template string, keysAndValues ...any)

func Panic

func Panic(args ...any)

func Panicf

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

func Panicw

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

func Sync

func Sync()

func Warn

func Warn(args ...any)

func Warnf

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

func Warnw

func Warnw(template string, keysAndValues ...any)

Types

type Config

type Config struct {
	Level           string `toml:"level" json:"level" yaml:"level"`
	Path            string `toml:"path" json:"path" yaml:"path"`
	FileName        string `toml:"file_name" json:"fileName" yaml:"fileName"`
	MaxSize         int    `toml:"max_size" json:"maxSize" yaml:"maxSize"`
	MaxBackups      int    `default:"0" toml:"max_backups" json:"maxBackups" yaml:"maxBackups"`
	MaxAgeDay       int    `toml:"max_age_day" json:"maxAgeDay" yaml:"maxAgeDay"`
	CompressEnabled bool   `toml:"compress_enabled" json:"compressEnabled" yaml:"compressEnabled"`
	StdoutEnabled   bool   `toml:"stdout_enabled" json:"stdoutEnabled" yaml:"stdoutEnabled"`
	JsonEnabled     bool   `toml:"json_enabled" json:"jsonEnabled" yaml:"jsonEnabled"`
}

type Logger

type Logger interface {
	Debug(args ...any)
	Debugf(template string, args ...any)
	Info(args ...any)
	Infof(template string, args ...any)
	Infow(template string, args ...any)
	Warn(args ...any)
	Warnf(template string, args ...any)
	Warnw(template string, args ...any)
	Error(args ...any)
	Errorf(template string, args ...any)
	Errorw(template string, args ...any)
	Fatal(args ...any)
	Fatalf(template string, args ...any)
	Fatalw(template string, args ...any)
	Panic(args ...any)
	Panicf(template string, args ...any)
	Panicw(template string, args ...any)
	Sync()
}

func Instance

func Instance() Logger

func New

func New(conf Config) (Logger, error)

New create a Logger instance

Jump to

Keyboard shortcuts

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