zap

package
v0.0.0-...-f5bbbf4 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Level  LoggerLevel
	Format LoggerFormat
}

func NewConfig

func NewConfig(level LoggerLevel, format LoggerFormat) *Config

type Logger

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

func NewLogger

func NewLogger(cfg *Config) (*Logger, error)

func (*Logger) Debug

func (l *Logger) Debug(msg string, keysAndValues ...interface{}) log.Logger

func (*Logger) Error

func (l *Logger) Error(msg string, keysAndValues ...interface{}) log.Logger

func (*Logger) Fatal

func (l *Logger) Fatal(msg string, keysAndValues ...interface{}) log.Logger

func (*Logger) Info

func (l *Logger) Info(msg string, keysAndValues ...interface{}) log.Logger

func (*Logger) Panic

func (l *Logger) Panic(msg string, keysAndValues ...interface{}) log.Logger

func (Logger) Sync

func (l Logger) Sync() error

func (*Logger) Warn

func (l *Logger) Warn(msg string, keysAndValues ...interface{}) log.Logger

func (Logger) With

func (l Logger) With(args ...interface{}) log.Logger

func (Logger) WithComponent

func (l Logger) WithComponent(component string) log.Logger

func (Logger) WithError

func (l Logger) WithError(err error) log.Logger

func (*Logger) Write

func (l *Logger) Write(p []byte) (n int, err error)

type LoggerFormat

type LoggerFormat string
const (
	TextFormat LoggerFormat = "text"
	JSONFormat LoggerFormat = "json"
)

type LoggerLevel

type LoggerLevel string
const (
	InfoLevel  LoggerLevel = "info"
	ErrorLevel LoggerLevel = "error"
	DebugLevel LoggerLevel = "debug"
	WarnLevel  LoggerLevel = "warn"
	PanicLevel LoggerLevel = "panic"
)

Jump to

Keyboard shortcuts

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