reverted log/format.go

This commit is contained in:
Trung Nguyen 2018-10-05 16:30:17 -04:00
parent 600852a5cb
commit e929349db4
No known key found for this signature in database
GPG Key ID: 4636434ED9505EB7
1 changed files with 2 additions and 12 deletions

View File

@ -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
}