mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-25 13:11:37 +00:00
Only log filename and not entire path (#1906)
This commit is contained in:
parent
ef331c52af
commit
70e4bbda3b
@ -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
|
// Append a newline + tab to it to move the actual log content to its own line
|
||||||
funcname += "\n\t"
|
funcname += "\n\t"
|
||||||
|
|
||||||
// Surround the filepath in brackets and append line number so IDEs can quickly
|
// Use a shortened file path which just has the filename to avoid having lots of redundant
|
||||||
// navigate
|
// directories which contribute significantly to overall log sizes!
|
||||||
filename := fmt.Sprintf(" [%s:%d]", f.File, f.Line)
|
filename := fmt.Sprintf(" [%s:%d]", path.Base(f.File), f.Line)
|
||||||
|
|
||||||
return funcname, filename
|
return funcname, filename
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user