diff --git a/log/format.go b/log/format.go index 11cdb3788..0b07abb2a 100644 --- a/log/format.go +++ b/log/format.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "reflect" - "runtime" "strconv" "strings" "sync" @@ -16,7 +15,7 @@ import ( const ( timeFormat = "2006-01-02T15:04:05-0700" - termTimeFormat = "01-02|15:04:05.000" + termTimeFormat = "01-02|15:04:05" floatFormat = 'f' termMsgJust = 40 ) @@ -108,7 +107,7 @@ func TerminalFormat(usecolor bool) Format { lvl := r.Lvl.AlignedString() if atomic.LoadUint32(&locationEnabled) != 0 { // Log origin printing was requested, format the location path and line number - location := fmt.Sprintf("%+v|%v", r.Call, getGID()) + location := fmt.Sprintf("%+v", r.Call) for _, prefix := range locationTrims { location = strings.TrimPrefix(location, prefix) } @@ -362,12 +361,3 @@ func escapeString(s string) string { stringBufPool.Put(e) return ret } - -func getGID() uint64 { - b := make([]byte, 64) - b = b[:runtime.Stack(b, false)] - b = bytes.TrimPrefix(b, []byte("goroutine ")) - b = b[:bytes.IndexByte(b, ' ')] - n, _ := strconv.ParseUint(string(b), 10, 64) - return n -} \ No newline at end of file