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) }