logger

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: Apache-2.0 Imports: 5 Imported by: 22

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.5.0

type Config struct {
	Mode       int    `yaml:"mode"`
	Level      string `yaml:"level"`
	Filename   string `yaml:"filename"`
	MaxSize    int    `yaml:"maxSize"`
	MaxBackups int    `yaml:"maxBackups"`
	MaxAge     int    `yaml:"maxAge"`
}

func (*Config) BuildConfig added in v0.5.0

func (c *Config) BuildConfig() *zap.Logger

type Field

type Field struct {
	Key   string
	Value any
}

func Any

func Any(key string, val any) Field

func Bool

func Bool(key string, val bool) Field

func Error

func Error(val error) Field

func Int32

func Int32(key string, val int32) Field

func Int64

func Int64(key string, val int64) Field

func Int64s

func Int64s(key string, val []int64) Field

func String

func String(key, val string) Field

func Strings

func Strings(key string, val []string) Field

type Logger

type Logger interface {
	Debug(msg string, args ...Field)
	Info(msg string, args ...Field)
	Warn(msg string, args ...Field)
	Error(msg string, args ...Field)
}

func NewZapLogger

func NewZapLogger(l *zap.Logger) Logger

type NopLogger

type NopLogger struct {
}

func (*NopLogger) Debug

func (n *NopLogger) Debug(msg string, args ...Field)

func (*NopLogger) Error

func (n *NopLogger) Error(msg string, args ...Field)

func (*NopLogger) Info

func (n *NopLogger) Info(msg string, args ...Field)

func (*NopLogger) Warn

func (n *NopLogger) Warn(msg string, args ...Field)

type ZapLogger

type ZapLogger struct {
	// contains filtered or unexported fields
}

func (*ZapLogger) Debug

func (z *ZapLogger) Debug(msg string, args ...Field)

func (*ZapLogger) Error

func (z *ZapLogger) Error(msg string, args ...Field)

func (*ZapLogger) Info

func (z *ZapLogger) Info(msg string, args ...Field)

func (*ZapLogger) Warn

func (z *ZapLogger) Warn(msg string, args ...Field)

Jump to

Keyboard shortcuts

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