logger

package
v0.0.0-...-0ca6d7b Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Key   string
	Value any
}

func Error

func Error(err error) Field

func Int

func Int(key string, val int) Field

func Int32

func Int32(key string, val int32) Field

func Int64

func Int64(key string, val int64) Field

func String

func String(key string, val string) Field

type LogError

type LogError struct {
	Msg    string
	Fields []Field
}

func LError

func LError(msg string, fields ...Field) *LogError

func (*LogError) Error

func (l *LogError) Error() string

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)
	With(args ...Field) Logger
}

type NopLogger

type NopLogger struct{}

func NewNopLogger

func NewNopLogger() *NopLogger

func (*NopLogger) Debug

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

func (*NopLogger) Error

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

func (*NopLogger) Info

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

func (*NopLogger) Warn

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

func (*NopLogger) With

func (z *NopLogger) With(args ...Field) Logger

type ZapLogger

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

func NewZapLogger

func NewZapLogger(l *zap.Logger) *ZapLogger

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)

func (*ZapLogger) With

func (z *ZapLogger) With(args ...Field) Logger

Jump to

Keyboard shortcuts

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