🎨 修改部分依赖

This commit is contained in:
2022-09-07 18:04:24 +08:00
parent 7ecc9ad8a4
commit cecfed7212
4 changed files with 118 additions and 4 deletions

View File

@@ -1,6 +1,9 @@
package log
import "go.uber.org/zap"
import (
"encoding/json"
"go.uber.org/zap"
)
// Debug uses fmt.Sprint to construct and log a message.
func Debug(args ...interface{}) {
@@ -73,3 +76,10 @@ func Fatalf(template string, args ...interface{}) {
defer zap.S().Sync()
zap.S().Fatalf(template, args...)
}
// Pretty provides pretty trace level logging
func Pretty(v ...interface{}) {
b, _ := json.MarshalIndent(v, "", " ")
defer zap.S().Sync()
zap.S().Info(string(b))
}