modify readme, add example

This commit is contained in:
wangjian 2022-07-13 13:48:31 +08:00
parent 1b0e214369
commit 613f1213b3
1 changed files with 33 additions and 1 deletions

View File

@ -1,3 +1,35 @@
# logging
日志组件
日志组件
## 使用说明
日志组件封装了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,
}
logger := logging.NewLogger()
logger.Info("this is a test log")
}
```