From ed1d0b7de250304fdb2102317e7f795649845ec3 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 8 Jul 2021 12:42:57 +0100 Subject: [PATCH] Only log filename and not entire path --- internal/log.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/log.go b/internal/log.go index 0f374bd4a..d2b233c5b 100644 --- a/internal/log.go +++ b/internal/log.go @@ -73,9 +73,9 @@ func callerPrettyfier(f *runtime.Frame) (string, string) { // Append a newline + tab to it to move the actual log content to its own line funcname += "\n\t" - // Surround the filepath in brackets and append line number so IDEs can quickly - // navigate - filename := fmt.Sprintf(" [%s:%d]", f.File, f.Line) + // Use a shortened file path which just has the filename to avoid having lots of redundant + // directories which contribute significantly to overall log sizes! + filename := fmt.Sprintf(" [%s:%d]", path.Base(f.File), f.Line) return funcname, filename }