mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-20 11:57:50 +02:00
Silence go-errcheck warning for fmt.Fprintf logging
This commit is contained in:
parent
f3764b2545
commit
f9372dda75
@ -87,7 +87,7 @@ func withLogging(s *statsd.Client, out io.Writer) Middleware {
|
||||
// log panics
|
||||
if err := recover(); err != nil {
|
||||
duration := time.Since(start)
|
||||
fmt.Fprintf(out, "%s %s %#v %s %s %s %v\n", getRemoteAddr(r), r.Method, r.RequestURI, getHishtoryVersion(r), duration.String(), byteCountToString(responseData.size), err)
|
||||
_, _ = fmt.Fprintf(out, "%s %s %#v %s %s %s %v\n", getRemoteAddr(r), r.Method, r.RequestURI, getHishtoryVersion(r), duration.String(), byteCountToString(responseData.size), err)
|
||||
|
||||
// keep panicking
|
||||
panic(err)
|
||||
@ -97,7 +97,7 @@ func withLogging(s *statsd.Client, out io.Writer) Middleware {
|
||||
h.ServeHTTP(&lrw, r.WithContext(ctx))
|
||||
|
||||
duration := time.Since(start)
|
||||
fmt.Fprintf(out, "%s %s %#v %s %s %s\n", getRemoteAddr(r), r.Method, r.RequestURI, getHishtoryVersion(r), duration.String(), byteCountToString(responseData.size))
|
||||
_, _ = fmt.Fprintf(out, "%s %s %#v %s %s %s\n", getRemoteAddr(r), r.Method, r.RequestURI, getHishtoryVersion(r), duration.String(), byteCountToString(responseData.size))
|
||||
if s != nil {
|
||||
s.Distribution("hishtory.request_duration", float64(duration.Microseconds())/1_000, []string{"handler:" + getFunctionName(h)}, 1.0)
|
||||
s.Incr("hishtory.request", []string{"handler:" + getFunctionName(h)}, 1.0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user