From f4f4d4b83da8534c07721bb913f29970063dc467 Mon Sep 17 00:00:00 2001 From: hoteas Date: Tue, 14 Nov 2017 10:27:09 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- const.go | 1 + error.go | 3 +++ objtoobj.go | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/const.go b/const.go index efa5695..1b73ae7 100644 --- a/const.go +++ b/const.go @@ -3,6 +3,7 @@ package hotime const ( LOG_FMT = 0 LOG_NIL = 1 + LOG_FILE=2 ) //锁关键字 diff --git a/error.go b/error.go index 2866d9b..c37fae9 100644 --- a/error.go +++ b/error.go @@ -31,6 +31,9 @@ func(this *Error)SetError(err error,loglevel ...int){ if lev==LOG_FMT{ fmt.Println(err) } + if lev==LOG_FILE{ + fmt.Println(err) + } this.err=err return nil }) diff --git a/objtoobj.go b/objtoobj.go index ae2da10..1753924 100644 --- a/objtoobj.go +++ b/objtoobj.go @@ -269,7 +269,7 @@ func StrToSlice(string string) Slice { //字符串数组: a1,a2,a3转["a1","a2","a3"] func StrArrayToJsonStr(a string) string { - if len(a) != 0 { + if len(a) > 2 { if a[0] == ',' { a = Substr(a, 1, len(a)-1) }