logx

package
v0.0.0-...-774e91b Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string)

func Debugf

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

func Debugw

func Debugw(msg string, fields ...Field)

func Error

func Error(err error)

func Errorf

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

func Errorw

func Errorw(msg string, fields ...Field)

func Fatal

func Fatal(msg string)

func Fatalf

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

func Fatalw

func Fatalw(msg string, fields ...Field)

func GetStack

func GetStack(err error) string

func Info

func Info(msg string)

func Infof

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

func Infow

func Infow(msg string, fields ...Field)

func MustUpSet

func MustUpSet(c *Conf)

func Panic

func Panic(msg string)

func Panicf

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

func Panicw

func Panicw(msg string, fields ...Field)

func ToMap

func ToMap(fields ...Field) map[string]interface{}

func Warn

func Warn(msg string)

func Warnf

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

func Warnw

func Warnw(msg string, fields ...Field)

Types

type Conf

type Conf struct {
	Server      string
	Level       Level
	GlobalField []Field
}

type Field

type Field struct {
	Key   string
	Value interface{}
}

func GetFields

func GetFields(r *http.Request) []Field

func GetFieldsByErr

func GetFieldsByErr(r *http.Request, err error) []Field

type GinCn

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

func NewGinCn

func NewGinCn(r *http.Request) *GinCn

func (*GinCn) Fn

func (c *GinCn) Fn(e *zerolog.Event)

type Level

type Level int8
const (
	LevelDebug Level = Level(zerolog.DebugLevel)
	InfoLevel  Level = Level(zerolog.InfoLevel)
	WarnLevel  Level = Level(zerolog.WarnLevel)
	ErrorLevel Level = Level(zerolog.ErrorLevel)
	FatalLevel Level = Level(zerolog.FatalLevel)
	PanicLevel Level = Level(zerolog.PanicLevel)
	NoLevel    Level = Level(zerolog.NoLevel)
	Disabled   Level = Level(zerolog.Disabled)
	TraceLevel Level = Level(zerolog.TraceLevel)
)

Jump to

Keyboard shortcuts

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