From 613f1213b38af0df612d755ab4e15c5cdc3baab4 Mon Sep 17 00:00:00 2001 From: wangjian Date: Wed, 13 Jul 2022 13:48:31 +0800 Subject: [PATCH] modify readme, add example --- README.md | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d60a82c..35064e1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,35 @@ # logging -日志组件 \ No newline at end of file +日志组件 + +## 使用说明 + +日志组件封装了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") +} +``` \ No newline at end of file