Skip to main content

log

成员函数函数描述/介绍
log.DebugDebugf will print when logger's Level is debug.
log.ErrorErrorf will print only when logger's Level is error, warn, info or debug.
log.InfoInfof will print when logger's Level is info or debug.
log.SetLevelloglevel 根据传入的字符串设置日志级别 disable: 禁用所有日志, fatal: 致命错误, error: 错误, warning: 警告, info: 信息, debug: 调试
log.Warn
log.debugDebugf will print when logger's Level is debug.
log.errorErrorf will print only when logger's Level is error, warn, info or debug.
log.infoInfof will print when logger's Level is info or debug.
log.setLevelloglevel 根据传入的字符串设置日志级别 disable: 禁用所有日志, fatal: 致命错误, error: 错误, warning: 警告, info: 信息, debug: 调试
log.warn

函数定义#

Debug#

详细描述#

Debugf will print when logger's Level is debug.

定义#

Debug(format string, args ...any)

参数#

参数名参数类型参数解释
formatstring
args...any

Error#

详细描述#

Errorf will print only when logger's Level is error, warn, info or debug.

定义#

Error(format string, args ...any)

参数#

参数名参数类型参数解释
formatstring
args...any

Info#

详细描述#

Infof will print when logger's Level is info or debug.

定义#

Info(format string, args ...any)

参数#

参数名参数类型参数解释
formatstring
args...any

SetLevel#

详细描述#

loglevel 根据传入的字符串设置日志级别

disable: 禁用所有日志, fatal: 致命错误, error: 错误, warning: 警告, info: 信息, debug: 调试

Example:

loglevel("fatal")

定义#

SetLevel(i any)

参数#

参数名参数类型参数解释
iany

Warn#

详细描述#

定义#

Warn(raw string, args ...any)

参数#

参数名参数类型参数解释
rawstring
args...any

debug#

详细描述#

Debugf will print when logger's Level is debug.

定义#

debug(format string, args ...any)

参数#

参数名参数类型参数解释
formatstring
args...any

error#

详细描述#

Errorf will print only when logger's Level is error, warn, info or debug.

定义#

error(format string, args ...any)

参数#

参数名参数类型参数解释
formatstring
args...any

info#

详细描述#

Infof will print when logger's Level is info or debug.

定义#

info(format string, args ...any)

参数#

参数名参数类型参数解释
formatstring
args...any

setLevel#

详细描述#

loglevel 根据传入的字符串设置日志级别

disable: 禁用所有日志, fatal: 致命错误, error: 错误, warning: 警告, info: 信息, debug: 调试

Example:

loglevel("fatal")

定义#

setLevel(i any)

参数#

参数名参数类型参数解释
iany

warn#

详细描述#

定义#

warn(raw string, args ...any)

参数#

参数名参数类型参数解释
rawstring
args...any