update golang
This commit is contained in:
@@ -8,13 +8,13 @@ import (
|
||||
|
||||
func Caller(depth int, full bool) string {
|
||||
const offset = 4
|
||||
_, file, line, ok := runtime.Caller(depth + offset)
|
||||
_, file, line, has := runtime.Caller(depth + offset)
|
||||
|
||||
if !ok {
|
||||
if !has {
|
||||
file, line = "???", 0
|
||||
}
|
||||
|
||||
if !full && ok {
|
||||
if !full && has {
|
||||
file = filepath.Base(file)
|
||||
}
|
||||
|
||||
|
||||
@@ -38,17 +38,17 @@ func WithLevel(lvl level.Level) Option {
|
||||
}
|
||||
|
||||
func New(opts ...Option) *Entry {
|
||||
e := &Entry{
|
||||
entry := &Entry{
|
||||
fields: make(field.Fields, 0, defaultCap+1),
|
||||
level: level.Debug,
|
||||
msg: "",
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(e)
|
||||
opt(entry)
|
||||
}
|
||||
|
||||
return e
|
||||
return entry
|
||||
}
|
||||
|
||||
// Entry slice field.
|
||||
|
||||
Reference in New Issue
Block a user