logger

package
v1.14.6 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: Apache-2.0 Imports: 9 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CyanColor added in v1.14.0

func CyanColor(str interface{}) string

CyanColor func

func GreenColor added in v1.14.0

func GreenColor(str interface{}) string

GreenColor func

func InitZap

func InitZap(opts ...OptionFunc)

InitZap logger with default writer to stdout

func Log

func Log(level zapcore.Level, message string, context string, scope string)

Log func

func LogE

func LogE(message string)

LogE error

func LogEf

func LogEf(format string, i ...interface{})

LogEf error with format

func LogGreen

func LogGreen(str string)

LogGreen log with green color

func LogI

func LogI(message string)

LogI info

func LogIf

func LogIf(format string, i ...interface{})

LogIf info with format

func LogIfError added in v1.11.26

func LogIfError(err error)

LogIfError log if error not nil

func LogPanicIfError added in v1.11.26

func LogPanicIfError(err error)

LogPanicIfError log if error not nil

func LogRed

func LogRed(str string)

LogRed log with red color

func LogWithDefer

func LogWithDefer(str string) (deferFunc func())

LogWithDefer return defer func for status

func LogWithField added in v1.9.3

func LogWithField(level zapcore.Level, fields map[string]interface{})

LogWithField func

func LogYellow

func LogYellow(str string)

LogYellow log with yellow color

func RedColor added in v1.14.0

func RedColor(str interface{}) string

RedColor func

func YellowColor added in v1.14.0

func YellowColor(str interface{}) string

YellowColor func

Types

type Option added in v1.9.3

type Option struct {
	MultiWriter []io.Writer
}

Option for init logger option

type OptionFunc added in v1.9.3

type OptionFunc func(*Option)

OptionFunc func

func OptionAddWriter added in v1.9.3

func OptionAddWriter(w io.Writer) OptionFunc

OptionAddWriter option func

func OptionSetWriter added in v1.12.2

func OptionSetWriter(w ...io.Writer) OptionFunc

OptionSetWriter option func, overide all log writer

Jump to

Keyboard shortcuts

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