Improved log format

This commit is contained in:
Mike Farah 2024-02-16 09:26:31 +11:00
parent d9e1a789ea
commit 9142c93d1b
2 changed files with 3 additions and 2 deletions

View File

@ -41,7 +41,7 @@ yq -P -oy sample.json
cmd.SetOut(cmd.OutOrStdout())
var format = logging.MustStringFormatter(
`%{color}%{time:15:04:05} %{shortfunc} [%{level:.4s}]%{color:reset} %{message}`,
`[%{level:5.5s}] %{color}%{time:15:04:05} %{color:bold} %{shortfile:-30s} %{shortfunc:-25s}%{color:reset} %{message}`,
)
var backend = logging.AddModuleLevel(
logging.NewBackendFormatter(logging.NewLogBackend(os.Stderr, "", 0), format))

View File

@ -252,3 +252,4 @@ zabbix
tonumber
noyaml
nolint
shortfile