From 1ea3660fc8b25a38612335d62ec3950c7d4d72f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Mengu=C3=A9?= Date: Thu, 17 Feb 2022 00:53:57 +0100 Subject: [PATCH 1/3] Add test of colors with ForceColor go test -v -run TestLogger/colorize --- logger_test.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/logger_test.go b/logger_test.go index 1d10e3e..3892bb0 100644 --- a/logger_test.go +++ b/logger_test.go @@ -257,6 +257,34 @@ func TestLogger(t *testing.T) { assert.Equal(t, "[INFO] sublogger: this is test\n", rest) }) + t.Run("colorize", func(t *testing.T) { + var buf bytes.Buffer + + logger := New(&LoggerOptions{ + // No name! + Output: &buf, + Level: Trace, + Color: ForceColor, + TimeFormat: "