logger

package
v0.0.0-...-7ab3369 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// LevelDebug debug level of logger
	LevelDebug = "debug"

	// LevelInfo info level of logger
	LevelInfo = "info"

	// LevelWarn warn level of logger
	LevelWarn = "warn"

	// LevelError error level of logger
	LevelError = "error"
)

Variables

This section is empty.

Functions

func AL

func AL(v ...any)

AL logs a message at alert level.

func CR

func CR(v ...any)

CR logs a message at critical level.

func CatLogger

func CatLogger(cat string) *wingLogger

Create a logger instance to output logs with ' [CAT] ' mark, notice that the mark will auto append '[]' and change to upper strings.

--------------------------------------------------------------------------- 2023/05/31 10:56:36.609 I [code_file.go:89] [CAT] FuncName() ... ---------------------------------------------------------------------------

func D

func D(v ...any)

D logs a message at debug level.

func E

func E(v ...any)

E logs a message at error level.

func EM

func EM(v ...any)

EM logs a message at emergency level.

func GetLevel

func GetLevel() string

GetLevel return current logger output level

func I

func I(v ...any)

I logs a message at info level.

func N

func N(v ...any)

N logs a message at notice level.

func NewLogger

func NewLogger(cat, tag string) *wingLogger

Create a logger instance to output logs with ' [CAT] ' mark and ' Tag:' perfix if set any string value, notice that the mark will auto append '[]' and change to upper strings, the tag will tail ':' if unexist end of target key.

--------------------------------------------------------------------------- 2023/05/31 10:56:36.609 I [code_file.go:89] [CAT] FuncName() Tag: xxx ... ---------------------------------------------------------------------------

`@see` Call logger.CatLogger() to create logger output category mark only.

`@see` Call logger.TagLogger() to create logger output target perfix key only.

func SetOutputLogger

func SetOutputLogger()

SetOutputLogger close console logger on prod mode and only remain file logger.

func TagLogger

func TagLogger(tag string) *wingLogger

Create a logger instance to output logs with ' Tag:' perfix in logs message, notice that the tag will auto tail ':' if unexist the char.

--------------------------------------------------------------------------- 2023/05/31 10:56:36.609 I [code_file.go:89] FuncName() Tag: xxx ... ---------------------------------------------------------------------------

func W

func W(v ...any)

W logs a message at warning level.

Types

This section is empty.

Jump to

Keyboard shortcuts

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