From 8d067a32db778f30d2872c96ac083dc8fec1b0db Mon Sep 17 00:00:00 2001 From: swliao425 <107254153+swliao425@users.noreply.github.com> Date: Tue, 27 Sep 2022 12:19:21 +0800 Subject: [PATCH] fix(aliyun log): 'format bool' is missing in 'toString' function (#2406) --- contrib/log/aliyun/aliyun.go | 2 ++ contrib/log/aliyun/aliyun_test.go | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/contrib/log/aliyun/aliyun.go b/contrib/log/aliyun/aliyun.go index 1be5f764c..a20d9ab69 100644 --- a/contrib/log/aliyun/aliyun.go +++ b/contrib/log/aliyun/aliyun.go @@ -159,6 +159,8 @@ func toString(v interface{}) string { key = strconv.FormatUint(v, 10) case string: key = v + case bool: + key = strconv.FormatBool(v) case []byte: key = string(v) default: diff --git a/contrib/log/aliyun/aliyun_test.go b/contrib/log/aliyun/aliyun_test.go index 1ceafc324..d7acf6bbd 100644 --- a/contrib/log/aliyun/aliyun_test.go +++ b/contrib/log/aliyun/aliyun_test.go @@ -92,4 +92,8 @@ func TestLog(t *testing.T) { if err != nil { t.Errorf("Log() returns error:%v", err) } + err = logger.Log(log.LevelDebug, true, 0) + if err != nil { + t.Errorf("Log() returns error:%v", err) + } }