Color the error messages in console command

This commit is contained in:
M. Mert Yildiran
2023-02-09 15:19:05 +03:00
parent 6ca727373c
commit 85da7f71ac

View File

@@ -5,6 +5,7 @@ import (
"net/url"
"os"
"os/signal"
"strings"
"time"
"github.com/creasty/defaults"
@@ -65,7 +66,11 @@ func runConsole() {
return
}
log.Info().Msg(string(message))
msg := string(message)
if strings.Contains(msg, ":ERROR]") {
msg = fmt.Sprintf(utils.Red, msg)
}
log.Info().Msg(msg)
}
}()