Skip to content

Commit

Permalink
added
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-holt-dochq committed Jul 12, 2021
1 parent da53584 commit e2e8bfc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,12 @@ func (t Logger) Log(i interface{}, fields interface{}, level uint32, verbose boo
// Check the current debug status
if verbose {
// Get the runtime caller
pc, line, _, _ := runtime.Caller(3)
details := runtime.FuncForPC(pc)
_, file, line, _ := runtime.Caller(3)

if level <= 2 {
outLog.Printf("%s [%s] [%s#%d] %s\n", timestring, levelToName(level), details.Name(), line, i)
outLog.Printf("%s [%s] [%s#%d] %s\n", timestring, levelToName(level), file, line, i)
} else {
errLog.Printf("%s [%s] [%s#%d] %s\n", timestring, levelToName(level), details.Name(), line, i)
errLog.Printf("%s [%s] [%s#%d] %s\n", timestring, levelToName(level), file, line, i)
}
} else {
// If debug, skip
Expand Down

0 comments on commit e2e8bfc

Please sign in to comment.