Skip to content

Commit

Permalink
fix: add missing isDebug checks for Debug logger
Browse files Browse the repository at this point in the history
  • Loading branch information
yaroslav-android committed Jul 10, 2024
1 parent 0ac1e1f commit 83933e4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions recorder/recorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package recorder

import (
"github.com/fatih/color"
"hometown-bot/build"
"hometown-bot/util"
"log"
)
Expand Down Expand Up @@ -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...))
}

Expand Down

0 comments on commit 83933e4

Please sign in to comment.