From 70e4bbda3b0b3eebc8a1c3f8e1bb1b1a85988070 Mon Sep 17 00:00:00 2001 From: kegsay Date: Thu, 8 Jul 2021 13:13:27 +0100 Subject: [PATCH] Only log filename and not entire path (#1906) --- 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 }