Skip to content

Commit

Permalink
added color to logging output
Browse files Browse the repository at this point in the history
  • Loading branch information
MatrixCrawler committed Apr 3, 2024
1 parent 3c380ed commit 0d07397
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func GetLogger() *logging.Logger {
logger := logging.MustGetLogger("tfswitch")

logBackend := logging.NewLogBackend(os.Stdout, "", 0)
format := logging.MustStringFormatter("%{time:15:04:05.000} %{shortfunc}: %{level} %{message}")
format := logging.MustStringFormatter("%{color}%{time:15:04:05.000} %{shortfunc}: %{level}%{color:reset} %{message}")
backendFormatter := logging.NewBackendFormatter(logBackend, format)
logging.SetBackend(backendFormatter)
return logger
Expand Down

0 comments on commit 0d07397

Please sign in to comment.