From 8d57a16f9cda55ee25f2db17713707998ecda4be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Garcia?= <vingarcia00@gmail.com> Date: Sun, 16 Jul 2023 22:47:38 -0300 Subject: [PATCH] Minor improvement to ksql.Logger output --- logger.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/logger.go b/logger.go index 5940f7f..a1f0c2e 100644 --- a/logger.go +++ b/logger.go @@ -56,7 +56,14 @@ func (l LogValues) MarshalJSON() ([]byte, error) { } out.Query = l.Query + out.Params = l.Params + + // Force it to print Params: [], instead of Params: null + if out.Params == nil { + out.Params = []interface{}{} + } + if l.Err != nil { out.Err = l.Err.Error() }