Documentation ¶
Index ¶
- Constants
- func AL(v ...any)
- func CR(v ...any)
- func CatLogger(cat string) *wingLogger
- func D(v ...any)
- func E(v ...any)
- func EM(v ...any)
- func GetLevel() string
- func I(v ...any)
- func N(v ...any)
- func NewLogger(cat, tag string) *wingLogger
- func SetOutputLogger()
- func TagLogger(tag string) *wingLogger
- func W(v ...any)
Constants ¶
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 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 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 ... ---------------------------------------------------------------------------
Types ¶
This section is empty.