log

package
v4.15.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Trace bool

Functions

func AddWriter

func AddWriter(writer io.Writer)

func Debug

func Debug(args ...any)

func Debugf

func Debugf(format string, args ...interface{})

func DeleteWriter

func DeleteWriter(writer io.Writer)

func Error

func Error(args ...any)

func Errorf

func Errorf(format string, args ...interface{})

Errorf logs a message at level Error on the standard logger.

func Fatalf

func Fatalf(format string, args ...interface{})

Fatalf logs a message at level Fatal on the standard logger then the process will exit with status set to 1.

func Info

func Info(args ...any)

func Infof

func Infof(format string, args ...interface{})

Infof logs a message at level Info on the standard logger.

func NameEncoder

func NameEncoder(loggerName string, enc zapcore.PrimitiveArrayEncoder)

func Panicf

func Panicf(format string, args ...interface{})

Panicf logs a message at level Panic on the standard logger.

func Warn

func Warn(args ...any)

func Warnf

func Warnf(format string, args ...interface{})

Warnf logs a message at level Warn on the standard logger.

Types

type Logger

type Logger struct {
	*zap.Logger
	// contains filtered or unexported fields
}
var LocaleLogger *Logger

func (*Logger) Debug

func (l *Logger) Debug(msg string, fields ...zap.Field)

func (*Logger) Error

func (l *Logger) Error(msg string, fields ...zap.Field)

func (*Logger) Fatal

func (l *Logger) Fatal(msg string, fields ...zap.Field)

func (*Logger) Info

func (l *Logger) Info(msg string, fields ...zap.Field)

func (Logger) Lang

func (l Logger) Lang(lang map[string]string) *Logger

func (Logger) Named

func (l Logger) Named(name string) *Logger

func (*Logger) Panic

func (l *Logger) Panic(msg string, fields ...zap.Field)

func (*Logger) Trace

func (l *Logger) Trace(msg string, fields ...zap.Field)

func (*Logger) Warn

func (l *Logger) Warn(msg string, fields ...zap.Field)

func (Logger) With

func (l Logger) With(fields ...zap.Field) *Logger

type MultipleWriter

type MultipleWriter struct {
	sync.Map // 用于存储多个输出
}

func (*MultipleWriter) Add

func (m *MultipleWriter) Add(writer io.Writer)

func (*MultipleWriter) Write

func (m *MultipleWriter) Write(p []byte) (n int, err error)

type Zap

type Zap interface {
	Lang(lang map[string]string) *Logger
	Named(name string) *Logger
	With(fields ...zap.Field) *Logger
	Trace(msg string, fields ...zap.Field)
	Debug(msg string, fields ...zap.Field)
	Info(msg string, fields ...zap.Field)
	Warn(msg string, fields ...zap.Field)
	Error(msg string, fields ...zap.Field)
}

Jump to

Keyboard shortcuts

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