package
0.0.0-20230221082639-0c8b833e4bae
Repository: https://github.com/gopherlinzy/gin-vue3-admin.git
Documentation: pkg.go.dev

# Functions

Debug 调试日志,详尽的程序日志 调用示例: logger.Debug("Database", zap.String("sql", sql)).
DebugJSON 记录对象类型的 debug 日志,使用 json.Marshal 进行编码。调用示例: logger.DebugJSON("Auth", "读取登录用户", auth.CurrentUser()).
DebugString 记录一条字符串类型的 debug 日志,调用示例: logger.DebugString("SMS", "短信内容", string(result.RawResponse)).
Dump 调试专用,不会中断程序,会在终端打印出 warning 消息。 第一个参数会使用 json.Marshal 进行渲染,第二个参数消息(可选) logger.Dump(user.User{Name:"test"}) logger.Dump(user.User{Name:"test"}, "用户信息").
Error 错误时记录,不应该中断程序,查看日志时重点关注.
No description provided by the author
No description provided by the author
Fatal 级别同 Error(), 写完 log 后调用 os.Exit(1) 退出程序.
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

Gohub_Logger 全局 Logger 对象.

# Structs

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