From fe56de06b55934e39274f04515df27666405c0ac Mon Sep 17 00:00:00 2001 From: IamCathal Date: Tue, 18 Aug 2020 21:30:39 +0100 Subject: [PATCH] Add enableFullFilePath field to BeeLogger --- pkg/logs/log.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/logs/log.go b/pkg/logs/log.go index 3a117327..3965eabb 100644 --- a/pkg/logs/log.go +++ b/pkg/logs/log.go @@ -115,6 +115,7 @@ type BeeLogger struct { init bool enableFuncCallDepth bool loggerFuncCallDepth int + enableFullFilePath bool asynchronous bool prefix string msgChanLen int64 @@ -654,6 +655,12 @@ func GetLogger(prefixes ...string) *log.Logger { return l } +// EnableFullFilePath enables full file path logging. Disabled by default +// e.g "/home/Documents/GitHub/beego/mainapp/" instead of "mainapp" +func EnableFullFilePath(b bool) { + beeLogger.enableFullFilePath = b +} + // Reset will remove all the adapter func Reset() { beeLogger.Reset()