[MM-31776] explicitly call level functions for mlog (#16648)
Automatic Merge
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
e89b26e8f3
Коммит
cfc501f5a6
@@ -87,22 +87,21 @@ func (c *Context) LogAuditWithUserId(userId, extraInfo string) {
|
||||
|
||||
func (c *Context) LogErrorByCode(err *model.AppError) {
|
||||
code := err.StatusCode
|
||||
var level mlog.LogLevel
|
||||
switch {
|
||||
case (code >= http.StatusBadRequest && code < http.StatusInternalServerError) ||
|
||||
err.Id == "web.check_browser_compatibility.app_error":
|
||||
level = mlog.LvlDebug
|
||||
case code == http.StatusNotImplemented:
|
||||
level = mlog.LvlInfo
|
||||
default:
|
||||
level = mlog.LvlError
|
||||
}
|
||||
c.Logger.Log(level,
|
||||
err.SystemMessage(utils.TDefault),
|
||||
msg := err.SystemMessage(utils.TDefault)
|
||||
fields := []mlog.Field{
|
||||
mlog.String("err_where", err.Where),
|
||||
mlog.Int("http_code", err.StatusCode),
|
||||
mlog.String("err_details", err.DetailedError),
|
||||
)
|
||||
}
|
||||
switch {
|
||||
case (code >= http.StatusBadRequest && code < http.StatusInternalServerError) ||
|
||||
err.Id == "web.check_browser_compatibility.app_error":
|
||||
c.Logger.Debug(msg, fields...)
|
||||
case code == http.StatusNotImplemented:
|
||||
c.Logger.Info(msg, fields...)
|
||||
default:
|
||||
c.Logger.Error(msg, fields...)
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Context) IsSystemAdmin() bool {
|
||||
|
||||
Ссылка в новой задаче
Block a user