mirror of
https://github.com/grafana/grafana.git
synced 2026-08-18 17:15:08 -05:00
remove the global log error/warn etc functions (#41404)
* remove the global log error/warn etc functions and use request context logger whenever possible
This commit is contained in:
@@ -739,7 +739,7 @@ func subscribeStatusToHTTPError(status backend.SubscribeStreamStatus) (int, stri
|
||||
case backend.SubscribeStreamStatusPermissionDenied:
|
||||
return http.StatusForbidden, http.StatusText(http.StatusForbidden)
|
||||
default:
|
||||
log.Warn("unknown subscribe status", "status", status)
|
||||
logger.Warn("unknown subscribe status", "status", status)
|
||||
return http.StatusInternalServerError, http.StatusText(http.StatusInternalServerError)
|
||||
}
|
||||
}
|
||||
@@ -751,7 +751,7 @@ func publishStatusToHTTPError(status backend.PublishStreamStatus) (int, string)
|
||||
case backend.PublishStreamStatusPermissionDenied:
|
||||
return http.StatusForbidden, http.StatusText(http.StatusForbidden)
|
||||
default:
|
||||
log.Warn("unknown publish status", "status", status)
|
||||
logger.Warn("unknown publish status", "status", status)
|
||||
return http.StatusInternalServerError, http.StatusText(http.StatusInternalServerError)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ func sameHostOriginCheck() func(r *http.Request) bool {
|
||||
return func(r *http.Request) bool {
|
||||
err := checkSameHost(r)
|
||||
if err != nil {
|
||||
log.Warn("Origin check failure", "origin", r.Header.Get("origin"), "error", err)
|
||||
logger.Warn("Origin check failure", "origin", r.Header.Get("origin"), "error", err)
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user