From c653a48667b484e327d88446290bb4832ea4c443 Mon Sep 17 00:00:00 2001 From: liangzy Date: Wed, 6 May 2020 14:34:31 +0800 Subject: [PATCH] =?UTF-8?q?v1.3.2=20=E5=A2=9E=E5=8A=A0=20glogs.Debug=20?= =?UTF-8?q?=E7=AD=89=E7=9B=B4=E6=8E=A5=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index d354ced..8e5e01d 100644 --- a/README.md +++ b/README.md @@ -58,35 +58,35 @@ import ( func TestGetLogger(t *testing.T) { // 新建 channel 大小为128 标识为nds 日志通道 , Get 的方法 默认带 console 和 file 输出 - l := Get("nds", 128).SetAdapter(LevelAll, AdapterElasticSearch) + l := grlogs.Get("nds", 128).SetAdapter(LevelAll, AdapterElasticSearch) l.Debug("我正在调试") l.Critical("出错了") // 复用 nds 的日志通道 - Get("nds").Warning("hadoee %s", time.Now().Format(time.RFC1123)) - Get("nds").Warning("hadoee %s", time.Now().Format(time.RFC1123)) + grlogs.Get("nds").Warning("hadoee %s", time.Now().Format(time.RFC1123)) + grlogs.Get("nds").Warning("hadoee %s", time.Now().Format(time.RFC1123)) // 新建 channel 大小为默认 标识为wifi 日志通道 , GetEs 的方法 默认带 console 和 file 和 elatisearch 输出 - GetEs("wifi") + grlogs.GetEs("wifi") for i := 0; i < 10; i++ { - Get("wifi").Warning("Warning") - Get("wifi").Warn("Warn") - Get("wifi").Debug("Debug") - Get("wifi").Error("Error") - Get("wifi").Notice("Notice") - Get("wifi").Info("Info") - Get("wifi").Alert("Alert") + grlogs.Get("wifi").Warning("Warning") + grlogs.Get("wifi").Warn("Warn") + grlogs.Get("wifi").Debug("Debug") + grlogs.Get("wifi").Error("Error") + grlogs.Get("wifi").Notice("Notice") + grlogs.Get("wifi").Info("Info") + grlogs.Get("wifi").Alert("Alert") } Get("wifi").Critical("neoweiwoewe") } func TestDropAdapter(t *testing.T) { - SetAdapter(LevelAll, AdapterAliLs) - DropAdapter(AdapterAliLs) - Informational(errors.New("he hello")) - SetAdapter(LevelAll, AdapterAliLs) - Debug(errors.New("he hello")) - CloseAll() + grlogs.SetAdapter(LevelAll, AdapterAliLs) + grlogs.DropAdapter(AdapterAliLs) + grlogs.Informational(errors.New("he hello")) + grlogs.SetAdapter(LevelAll, AdapterAliLs) + grlogs.Debug(errors.New("he hello")) + grlogs.CloseAll() } ``` \ No newline at end of file