Color stdout debug logs gray (#6726)

Helps visually break up the logs. Info level logs will still appear
white.
This commit is contained in:
Phil Porada 2023-03-08 16:04:20 -05:00 committed by GitHub
parent 9e2a8d3882
commit d4ecfcb1a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -239,9 +239,13 @@ func (w *stdoutWriter) logAtLevel(level syslog.Priority, msg string) {
const red = "\033[31m\033[1m"
const yellow = "\033[33m"
const gray = "\033[37m\033[2m"
if w.isatty {
if int(level) == int(syslog.LOG_WARNING) {
if int(level) == int(syslog.LOG_DEBUG) {
color = gray
reset = "\033[0m"
} else if int(level) == int(syslog.LOG_WARNING) {
color = yellow
reset = "\033[0m"
} else if int(level) <= int(syslog.LOG_ERR) {