mirror of
https://github.com/matrix-org/dendrite
synced 2024-12-14 07:12:53 +00:00
Improve roomserver logging
This commit is contained in:
parent
d21f3eace0
commit
07d0e72a8b
2 changed files with 21 additions and 0 deletions
|
@ -42,6 +42,19 @@ const (
|
||||||
KindOld
|
KindOld
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (k Kind) String() string {
|
||||||
|
switch k {
|
||||||
|
case KindOutlier:
|
||||||
|
return "KindOutlier"
|
||||||
|
case KindNew:
|
||||||
|
return "KindNew"
|
||||||
|
case KindOld:
|
||||||
|
return "KindOld"
|
||||||
|
default:
|
||||||
|
return "(unknown)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// DoNotSendToOtherServers tells us not to send the event to other matrix
|
// DoNotSendToOtherServers tells us not to send the event to other matrix
|
||||||
// servers.
|
// servers.
|
||||||
const DoNotSendToOtherServers = ""
|
const DoNotSendToOtherServers = ""
|
||||||
|
|
|
@ -93,8 +93,16 @@ func (r *Inputer) processRoomEvent(
|
||||||
logger := util.GetLogger(ctx).WithFields(logrus.Fields{
|
logger := util.GetLogger(ctx).WithFields(logrus.Fields{
|
||||||
"event_id": event.EventID(),
|
"event_id": event.EventID(),
|
||||||
"room_id": event.RoomID(),
|
"room_id": event.RoomID(),
|
||||||
|
"kind": input.Kind,
|
||||||
|
"origin": input.Origin,
|
||||||
"type": event.Type(),
|
"type": event.Type(),
|
||||||
})
|
})
|
||||||
|
if input.HasState {
|
||||||
|
logger = logger.WithFields(logrus.Fields{
|
||||||
|
"has_state": input.HasState,
|
||||||
|
"state_ids": len(input.StateEventIDs),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// if we have already got this event then do not process it again, if the input kind is an outlier.
|
// if we have already got this event then do not process it again, if the input kind is an outlier.
|
||||||
// Outliers contain no extra information which may warrant a re-processing.
|
// Outliers contain no extra information which may warrant a re-processing.
|
||||||
|
|
Loading…
Reference in a new issue