File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -15,24 +15,23 @@ var (
15
15
)
16
16
17
17
func init () {
18
- flag := log .Ldate | log .Ltime
18
+ flag := log .Ldate | log .Ltime
19
19
outLogger = log .New (os .Stdout , "" , flag )
20
20
errLogger = log .New (os .Stderr , "" , flag )
21
21
}
22
22
23
23
// Get the file and function information of the logger caller.
24
- // Result: "filename :line:function"
24
+ // Result: "file :line:function"
25
25
func getOrigin () string {
26
26
// calldepth is 2: caller -> xxxPrintf() -> getOrigin()
27
27
pc , file , line , ok := runtime .Caller (2 )
28
28
if ! ok {
29
- return "???:0 :???"
29
+ return "???:? :???"
30
30
}
31
31
32
- filename := file [strings .LastIndex (file , "/" )+ 1 :]
33
32
funcname := runtime .FuncForPC (pc ).Name ()
34
33
fn := funcname [strings .LastIndex (funcname , "." )+ 1 :]
35
- return filename + ":" + strconv .Itoa (line ) + ":" + fn
34
+ return file + ":" + strconv .Itoa (line ) + ":" + fn
36
35
}
37
36
38
37
func DebugPrintf (format string , v ... interface {}) {
You can’t perform that action at this time.
0 commit comments