aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorkegsay <kegan@matrix.org>2021-07-08 13:13:27 +0100
committerGitHub <noreply@github.com>2021-07-08 13:13:27 +0100
commit70e4bbda3b0b3eebc8a1c3f8e1bb1b1a85988070 (patch)
tree05a48e2686cfcc0106222cb756e7e6a3887e6de0 /internal
parentef331c52af7606062d9d7584e6c004cf363d01eb (diff)
Only log filename and not entire path (#1906)
Diffstat (limited to 'internal')
-rw-r--r--internal/log.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/log.go b/internal/log.go
index 0f374bd4..d2b233c5 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
}