avoid holding the req log lock for so long
This commit is contained in:
parent
f073f29a09
commit
1d747a6f68
|
@ -205,8 +205,9 @@ func (r *GenRouter) ddumpRequest(req *http.Request, pre string, l *RouterLog, sb
|
||||||
nfield("\nIP: ", req.RemoteAddr)
|
nfield("\nIP: ", req.RemoteAddr)
|
||||||
sb.WriteString("\n")
|
sb.WriteString("\n")
|
||||||
|
|
||||||
|
str := sb.String()
|
||||||
l.RLock()
|
l.RLock()
|
||||||
l.LogVal.Load().(*log.Logger).Print(sb.String())
|
l.LogVal.Load().(*log.Logger).Print(str)
|
||||||
l.RUnlock()
|
l.RUnlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue