Skip to content

Commit

Permalink
PM-2341: Tweak traces.
Browse files Browse the repository at this point in the history
  • Loading branch information
aakoshh committed Jun 18, 2021
1 parent c7cb63a commit 468078a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Expand Up @@ -37,6 +37,8 @@ object RobotConsensusTracers {

HybridLog.instance[RobotConsensusEvent](
level = {
case e: Error if e.message.contains("SendMessage") =>
HybridLogObject.Level.Debug
case _: Error => HybridLogObject.Level.Error
case _: Timeout => HybridLogObject.Level.Warn
case _: Rejected[_] => HybridLogObject.Level.Warn
Expand Down Expand Up @@ -91,7 +93,8 @@ object RobotConsensusTracers {

case e: Rejected[_] =>
JsonObject(
"errorType" -> e.error.getClass.getSimpleName.asJson
"errorType" -> e.error.getClass.getSimpleName.asJson,
"error" -> e.error.toString.asJson
)

case e: ExecutionSkipped[_] =>
Expand Down
Expand Up @@ -42,8 +42,12 @@ object RobotNetworkTracers {
e.peer.asJsonObject.add("error", e.error.toString.asJson)
case e: ConnectionReceiveError[_] =>
e.peer.asJsonObject.add("error", e.error.toString.asJson)
case e: NetworkEvent.MessageReceived[_, _] => e.peer.asJsonObject
case e: NetworkEvent.MessageSent[_, _] => e.peer.asJsonObject
case e: NetworkEvent.MessageReceived[_, _] =>
e.peer.asJsonObject
.add("messageType", e.message.getClass.getSimpleName.asJson)
case e: NetworkEvent.MessageSent[_, _] =>
e.peer.asJsonObject
.add("messageType", e.message.getClass.getSimpleName.asJson)
}
)
}
Expand Down

0 comments on commit 468078a

Please sign in to comment.