Skip to content

Commit

Permalink
fix:添加注释
Browse files Browse the repository at this point in the history
  • Loading branch information
yezihack committed Jun 25, 2019
1 parent be8fbe6 commit e5af624
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
- 以key-value形式打印日志,适合项目里使用
- 加入Dump打印数据详细类型结构,融入[go-spew](https://github.com/davecgh/go-spew)调度利器

### 文档参考
- https://godoc.org/github.com/ThreeKing2018/k3log

### 安装
```
go get -u github.com/ThreeKing2018/k3log
Expand Down
14 changes: 8 additions & 6 deletions init.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,35 +35,37 @@ func SetLogLevel(level conf.Level) {
l.SetLogLevel(level)
}

//日志同步写入
//目前只有zap生效
func Sync() {
l.Sync()
}

//key value
//日志等级 调试时使用
func Debug(keysAndValues ...interface{}) {
l.Debug(keysAndValues...)
}

//日志等级 提示时使用
func Info(keysAndValues ...interface{}) {
l.Info(keysAndValues...)
}

//日志等级 警告时使用
func Warn(keysAndValues ...interface{}) {
l.Warn(keysAndValues...)
}

//日志等级 错误时使用
func Error(keysAndValues ...interface{}) {
l.Error(keysAndValues...)
}

//日志等级 恐慌时使用
func Panic(keysAndValues ...interface{}) {
l.Panic(keysAndValues...)
}

//日志等级 致命时使用
func Fatal(keysAndValues ...interface{}) {
l.Fatal(keysAndValues...)
}
//日志等级 详细结构类型,调试利器
func Dump(keysAndValues ...interface{}) {
l.Dump(keysAndValues...)
}

0 comments on commit e5af624

Please sign in to comment.