logging/README.md

35 lines
659 B
Markdown
Raw Normal View History

2022-07-13 09:54:08 +08:00
# logging
2022-07-13 13:48:31 +08:00
日志组件
## 使用说明
日志组件封装了uber/zap使用基本一致
```
package main
import(
"git.hpds.cc/Component/logging"
"go.uber.org/zap/zapcore"
)
func main(){
opt := Options{
Path : "./log/",
Prefix : "",
ErrorFileSuffix: "",
WarnFileSuffix : "",
InfoFileSuffix : "",
DebugFileSuffix: "",
Level : zapcore.DebugLevel,
MaxSize : 100,
MaxBackups : 1000,
MaxAge : 30,
Development : true,
}
2022-07-13 13:49:11 +08:00
logger := logging.NewLogger(opt)
2022-07-13 13:48:31 +08:00
logger.Info("this is a test log")
}
```