package
1.0.2
Repository: https://github.com/wcs1010270451/helpers.git
Documentation: pkg.go.dev

# Functions

Debug 调试日志,详尽的程序日志.
DebugJSON 记录对象类型的 debug 日志,使用 json.Marshal 进行编码。调用示例: logger.DebugJSON("Auth", "读取登录用户", auth.CurrentUser()).
DebugString 记录一条字符串类型的 debug 日志,调用示例:.
Dump 调试专用,不会中断程序,会在终端打印出 warning 消息。.
Error 错误时记录,不应该中断程序,查看日志时重点关注.
No description provided by the author
No description provided by the author
Fatal 级别同 Error(), 写完 log 后调用 os.Exit(1) 退出程序 logger.DebugString("SMS", "短信内容", string(result.RawResponse)).
No description provided by the author
No description provided by the author
Info 告知类日志.
No description provided by the author
No description provided by the author
InitLogger 日志初始化.
LogIf 当 err != nil 时记录 error 等级的日志.
LogInfoIf 当 err != nil 时记录 info 等级的日志.
LogWarnIf 当 err != nil 时记录 warning 等级的日志.
NewGormLogger 外部调用。实例化一个 GormLogger 对象,示例: DB, err := gorm.Open(dbConfig, &gorm.Config{ Logger: logger.NewGormLogger(), }).
Warn 警告类.
No description provided by the author
No description provided by the author

# Variables

Logger 全局 Logger 对象.

# Structs

GormLogger 操作对象,实现 gormlogger.Interface.