From 83933e415c43c25a2292784a607c5b3de4b5e0d6 Mon Sep 17 00:00:00 2001 From: Yaroslav Ovdiienko Date: Wed, 10 Jul 2024 14:46:28 +0200 Subject: [PATCH] fix: add missing `isDebug` checks for Debug logger --- recorder/recorder.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recorder/recorder.go b/recorder/recorder.go index a7a9440..89a4d76 100644 --- a/recorder/recorder.go +++ b/recorder/recorder.go @@ -2,6 +2,7 @@ package recorder import ( "github.com/fatih/color" + "hometown-bot/build" "hometown-bot/util" "log" ) @@ -41,14 +42,17 @@ func (i *InfoRecorder) println(v ...any) { } func (i *DebugRecorder) print(v ...any) { + if !build.IsDebug { return } i.logger.Print(util.WrapInColor(color.FgGreen, v...)) } func (i *DebugRecorder) printf(format string, v ...any) { + if !build.IsDebug { return } i.logger.Print(util.WrapInColorf(color.FgGreen, format, v...)) } func (i *DebugRecorder) println(v ...any) { + if !build.IsDebug { return } i.logger.Print(util.WrapInColorln(color.FgGreen, v...)) }