From 9142c93d1b801372e2a6981ff69ecebaaf9e4a62 Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Fri, 16 Feb 2024 09:26:31 +1100 Subject: [PATCH] Improved log format --- cmd/root.go | 2 +- project-words.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 76caf72a..0b8af419 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -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)) diff --git a/project-words.txt b/project-words.txt index a361252c..39080c11 100644 --- a/project-words.txt +++ b/project-words.txt @@ -251,4 +251,5 @@ yuin zabbix tonumber noyaml -nolint \ No newline at end of file +nolint +shortfile \ No newline at end of file