diff options
Diffstat (limited to 'modules/log/log.go')
-rw-r--r-- | modules/log/log.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/log/log.go b/modules/log/log.go index 82492ce3fa..c1db6c6cdb 100644 --- a/modules/log/log.go +++ b/modules/log/log.go @@ -214,7 +214,11 @@ func (l *Logger) writerMsg(skip, level int, msg string) error { fnName = strings.TrimLeft(filepath.Ext(fn.Name()), ".") + "()" } - lm.msg = fmt.Sprintf("[%s:%d %s] %s", filepath.Base(file), line, fnName, msg) + fileName := file + if len(fileName) > 20 { + fileName = "..." + fileName[len(fileName)-20:] + } + lm.msg = fmt.Sprintf("[%s:%d %s] %s", fileName, line, fnName, msg) } else { lm.msg = msg } |