logger

package
v0.0.0-...-f8bc7e3 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTPMethod     = "http.request.method"
	HTTPReqBody    = "http.request.body.content"
	HTTPStatusCode = "http.response.status_code"
	HTTPResBody    = "http.response.body.content"
	SrcAddr        = "source.address"
	DstAddr        = "destination.address"
	UserAgent      = "user_agent.original"
	URLOriginal    = "url.original"
	URLPath        = "url.path"
	URLQuery       = "url.query"
)
View Source
const (
	DebugLevel = "debug"
	InfoLevel  = "info"
	WarnLevel  = "warn"
	ErrorLevel = "error"
	FatalLevel = "fatal"
)

Variables

This section is empty.

Functions

func DPanicf

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

func DPanicw

func DPanicw(msg string, keysAndValues ...interface{})

func Debugf

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

func Debugw

func Debugw(msg string, keysAndValues ...interface{})

func Errorf

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

func Errorw

func Errorw(msg string, keysAndValues ...interface{})

func Fatalf

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

func Fatalw

func Fatalw(msg string, keysAndValues ...interface{})

func Infof

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

func Infow

func Infow(msg string, keysAndValues ...interface{})

func Init

func Init(config *Config)

func Panicf

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

func Panicw

func Panicw(msg string, keysAndValues ...interface{})

func Warnf

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

func Warnw

func Warnw(msg string, keysAndValues ...interface{})

func Zap

func Zap() *zap.Logger

Types

type Config

type Config struct {
	EnableConsole     bool
	ConsoleWriteAsync bool
	ConsoleJSONFormat bool
	ConsoleLevel      string
	EnableFile        bool
	FileWriteAsync    bool
	FileJSONFormat    bool
	FileLevel         string
	FileName          string
	MaxSize           int
	MaxBackups        int
	Compress          bool
	AddCaller         bool
	MaxFileHistory    int
}

type Fields

type Fields map[string]interface{}

type Logger

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

func NewLogger

func NewLogger(config *Config) *Logger

func WithFields

func WithFields(fields Fields) *Logger

func (*Logger) DPanicf

func (l *Logger) DPanicf(format string, args ...interface{})

func (*Logger) DPanicw

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

func (*Logger) Debugf

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

func (*Logger) Debugw

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

func (*Logger) Errorf

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

func (*Logger) Errorw

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

func (*Logger) Fatalf

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

func (*Logger) Fatalw

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

func (*Logger) Infof

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

func (*Logger) Infow

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

func (*Logger) Panicf

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

func (*Logger) Panicw

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

func (*Logger) Warnf

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

func (*Logger) Warnw

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

func (*Logger) Zap

func (l *Logger) Zap() *zap.Logger

Jump to

Keyboard shortcuts

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