Review error logging (#10897)
This change lowers the levels of a few log messages in an attempt to bring them more in line with the severity of the actual message.
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
f8a89a52fc
Коммит
8c048a6604
@@ -376,7 +376,7 @@ func (a *App) WaitForChannelMembership(channelId string, userId string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we received a error but it wasn't a missing channel member then return
|
// If we received an error, but it wasn't a missing channel member then return
|
||||||
if err.Id != store.MISSING_CHANNEL_MEMBER_ERROR {
|
if err.Id != store.MISSING_CHANNEL_MEMBER_ERROR {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const MaxOpenGraphResponseSize = 1024 * 1024 * 50
|
|||||||
func (a *App) GetOpenGraphMetadata(requestURL string) *opengraph.OpenGraph {
|
func (a *App) GetOpenGraphMetadata(requestURL string) *opengraph.OpenGraph {
|
||||||
res, err := a.HTTPService.MakeClient(false).Get(requestURL)
|
res, err := a.HTTPService.MakeClient(false).Get(requestURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
mlog.Error("GetOpenGraphMetadata request failed", mlog.String("requestURL", requestURL), mlog.Err(err))
|
mlog.Warn("GetOpenGraphMetadata request failed", mlog.String("requestURL", requestURL), mlog.Err(err))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
defer res.Body.Close()
|
defer res.Body.Close()
|
||||||
@@ -31,7 +31,7 @@ func (a *App) ParseOpenGraphMetadata(requestURL string, body io.Reader, contentT
|
|||||||
body = forceHTMLEncodingToUTF8(io.LimitReader(body, MaxOpenGraphResponseSize), contentType)
|
body = forceHTMLEncodingToUTF8(io.LimitReader(body, MaxOpenGraphResponseSize), contentType)
|
||||||
|
|
||||||
if err := og.ProcessHTML(body); err != nil {
|
if err := og.ProcessHTML(body); err != nil {
|
||||||
mlog.Error("ParseOpenGraphMetadata processing failed", mlog.String("requestURL", requestURL), mlog.Err(err))
|
mlog.Warn("ParseOpenGraphMetadata processing failed", mlog.String("requestURL", requestURL), mlog.Err(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
makeOpenGraphURLsAbsolute(og, requestURL)
|
makeOpenGraphURLsAbsolute(og, requestURL)
|
||||||
@@ -54,7 +54,7 @@ func (a *App) ParseOpenGraphMetadata(requestURL string, body io.Reader, contentT
|
|||||||
func forceHTMLEncodingToUTF8(body io.Reader, contentType string) io.Reader {
|
func forceHTMLEncodingToUTF8(body io.Reader, contentType string) io.Reader {
|
||||||
r, err := charset.NewReader(body, contentType)
|
r, err := charset.NewReader(body, contentType)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
mlog.Error("forceHTMLEncodingToUTF8 failed to convert", mlog.String("contentType", contentType), mlog.Err(err))
|
mlog.Warn("forceHTMLEncodingToUTF8 failed to convert", mlog.String("contentType", contentType), mlog.Err(err))
|
||||||
return body
|
return body
|
||||||
}
|
}
|
||||||
return r
|
return r
|
||||||
|
|||||||
@@ -200,9 +200,9 @@ func (c *WebConn) writePump() {
|
|||||||
|
|
||||||
if len(c.Send) >= SEND_DEADLOCK_WARN {
|
if len(c.Send) >= SEND_DEADLOCK_WARN {
|
||||||
if evtOk {
|
if evtOk {
|
||||||
mlog.Error(fmt.Sprintf("websocket.full: message userId=%v type=%v channelId=%v size=%v", c.UserId, msg.EventType(), evt.Broadcast.ChannelId, len(msg.ToJson())))
|
mlog.Warn(fmt.Sprintf("websocket.full: message userId=%v type=%v channelId=%v size=%v", c.UserId, msg.EventType(), evt.Broadcast.ChannelId, len(msg.ToJson())))
|
||||||
} else {
|
} else {
|
||||||
mlog.Error(fmt.Sprintf("websocket.full: message userId=%v type=%v size=%v", c.UserId, msg.EventType(), len(msg.ToJson())))
|
mlog.Warn(fmt.Sprintf("websocket.full: message userId=%v type=%v size=%v", c.UserId, msg.EventType(), len(msg.ToJson())))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user