|
|
@ -5,7 +5,6 @@ import ( |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
"io" |
|
|
|
"io" |
|
|
|
"path" |
|
|
|
"path" |
|
|
|
"runtime" |
|
|
|
|
|
|
|
"strings" |
|
|
|
"strings" |
|
|
|
"sync" |
|
|
|
"sync" |
|
|
|
"time" |
|
|
|
"time" |
|
|
@ -111,16 +110,16 @@ func keyFactory(key string) func(map[string]interface{}) string { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func longSource(map[string]interface{}) string { |
|
|
|
func longSource(d map[string]interface{}) string { |
|
|
|
if _, file, lineNo, ok := runtime.Caller(6); ok { |
|
|
|
if fn, ok := d[_source].(string); ok { |
|
|
|
return fmt.Sprintf("%s:%d", file, lineNo) |
|
|
|
return fn |
|
|
|
} |
|
|
|
} |
|
|
|
return "unknown:0" |
|
|
|
return "unknown:0" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func shortSource(map[string]interface{}) string { |
|
|
|
func shortSource(d map[string]interface{}) string { |
|
|
|
if _, file, lineNo, ok := runtime.Caller(6); ok { |
|
|
|
if fn, ok := d[_source].(string); ok { |
|
|
|
return fmt.Sprintf("%s:%d", path.Base(file), lineNo) |
|
|
|
return path.Base(fn) |
|
|
|
} |
|
|
|
} |
|
|
|
return "unknown:0" |
|
|
|
return "unknown:0" |
|
|
|
} |
|
|
|
} |
|
|
|