Add log.IsGreaterOrEqualTo, that take into consideration path-scoped log levels

This commit is contained in:
Deluan
2023-12-25 16:29:59 -05:00
parent 03119e5ccf
commit 51e07d4cb5
13 changed files with 60 additions and 19 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ func (j *Executor) start() error {
j.ctx = ctx
cmd := exec.CommandContext(ctx, j.args[0], j.args[1:]...) // #nosec
cmd.Stdout = j.out
if log.CurrentLevel() >= log.LevelTrace {
if log.IsGreaterOrEqualTo(log.LevelTrace) {
cmd.Stderr = os.Stderr
} else {
cmd.Stderr = io.Discard