mirror of
https://github.com/beego/bee.git
synced 2025-07-04 21:50:18 +00:00
Fixes the filename and lineNo in debug log message
This commit is contained in:

committed by
Faissal Elamraoui

parent
c3c264ddb5
commit
deacdaa667
12
util.go
12
util.go
@ -262,3 +262,15 @@ func IsDebugEnabled() bool {
|
||||
debugMode := os.Getenv("DEBUG_ENABLED")
|
||||
return map[string]bool{"1": true, "0": false}[debugMode]
|
||||
}
|
||||
|
||||
// __FILE__ returns the file name in which the function was invoked
|
||||
func __FILE__() string {
|
||||
_, file, _, _ := runtime.Caller(1)
|
||||
return file
|
||||
}
|
||||
|
||||
// __LINE__ returns the line number at which the function was invoked
|
||||
func __LINE__() int {
|
||||
_, _, line, _ := runtime.Caller(1)
|
||||
return line
|
||||
}
|
||||
|
Reference in New Issue
Block a user