log icon indicating copy to clipboard operation
log copied to clipboard

preserve Entry's internal vars when calling Entry.WithFields

Open moul opened this issue 7 years ago • 0 comments

This way, it's possible to do things like this:

trace := log.Trace("test")
ret, err := handler()
if err != nil {
    trace = trace.WithFields(...custom fields just in case of error...)
}
trace.Stop(&err)

moul avatar Jun 22 '17 16:06 moul