logutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorPretty

func ColorPretty(a ...interface{})

func Enabled

func Enabled(lvl zapcore.Level, loggers ...*zap.Logger) bool

func ErrField

func ErrField(err error, fields ...zap.Field) []zap.Field

func ErrRecord

func ErrRecord(log *zap.Logger, err error, fieldHandle ...func() Fields) bool

func ErrTry

func ErrTry(log *zap.Logger, fn func(), fields ...zap.Field)

func FuncStack

func FuncStack(fn interface{}) zap.Field

func LogOrErr

func LogOrErr(log *zap.Logger, msg string, fn func() error, fields ...zap.Field)

func LogOrPanic

func LogOrPanic(log *zap.Logger, msg string, fn func() error, fields ...zap.Field)

func Names

func Names(names ...string) string

func OkOrErr

func OkOrErr(log *zap.Logger, msg string, fn func() error, fields ...zap.Field)

func OkOrPanic

func OkOrPanic(log *zap.Logger, msg string, fn func() error, fields ...zap.Field)

func Pretty

func Pretty(a ...interface{})

Types

type Fields

type Fields = []zap.Field

type Map

type Map map[string]interface{}

func (Map) Fields

func (t Map) Fields() []zap.Field

Jump to

Keyboard shortcuts

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