@@ -99,7 +99,9 @@ class RLPxConnectionHandler(
9999
100100 case Failure (ex) =>
101101 log.debug(
102- s " [Stopping Connection] Init AuthHandshaker message handling failed for peer $peerId due to ${ex.getMessage}"
102+ s " [Stopping Connection] Init AuthHandshaker message handling failed for peer {} due to {} " ,
103+ peerId,
104+ ex.getMessage
103105 )
104106 context.parent ! ConnectionFailed
105107 context stop self
@@ -125,7 +127,9 @@ class RLPxConnectionHandler(
125127
126128 case Failure (ex) =>
127129 log.debug(
128- s " [Stopping Connection] Response AuthHandshaker message handling failed for peer $peerId due to ${ex.getMessage}"
130+ s " [Stopping Connection] Response AuthHandshaker message handling failed for peer {} due to {} " ,
131+ peerId,
132+ ex.getMessage
129133 )
130134 context.parent ! ConnectionFailed
131135 context stop self
@@ -145,15 +149,15 @@ class RLPxConnectionHandler(
145149 }
146150
147151 def handleTimeout : Receive = { case AuthHandshakeTimeout =>
148- log.debug(s " [Stopping Connection] Auth handshake timeout for peer $peerId " )
152+ log.debug(s " [Stopping Connection] Auth handshake timeout for peer {} " , peerId )
149153 context.parent ! ConnectionFailed
150154 context stop self
151155 }
152156
153157 def processHandshakeResult (result : AuthHandshakeResult , remainingData : ByteString ): Unit =
154158 result match {
155159 case AuthHandshakeSuccess (secrets, remotePubKey) =>
156- log.debug(s " Auth handshake succeeded for peer $peerId " )
160+ log.debug(s " Auth handshake succeeded for peer {} " , peerId )
157161 context.parent ! ConnectionEstablished (remotePubKey)
158162 if (remainingData.nonEmpty)
159163 context.self ! Received (remainingData)
@@ -162,7 +166,7 @@ class RLPxConnectionHandler(
162166 context become awaitInitialHello(extractor(secrets))
163167
164168 case AuthHandshakeError =>
165- log.debug(s " [Stopping Connection] Auth handshake failed for peer $peerId " )
169+ log.debug(s " [Stopping Connection] Auth handshake failed for peer {} " , peerId )
166170 context.parent ! ConnectionFailed
167171 context stop self
168172 }
@@ -201,7 +205,7 @@ class RLPxConnectionHandler(
201205
202206 case AckTimeout (ackSeqNumber) if cancellableAckTimeout.exists(_.seqNumber == ackSeqNumber) =>
203207 cancellableAckTimeout.foreach(_.cancellable.cancel())
204- log.error(s " [Stopping Connection] Sending 'Hello' to $peerId failed " )
208+ log.error(s " [Stopping Connection] Sending 'Hello' to {} failed " , peerId )
205209 context stop self
206210
207211 }
@@ -227,12 +231,12 @@ class RLPxConnectionHandler(
227231 seqNumber = seqNumber
228232 )
229233 case None =>
230- log.debug(s " [Stopping Connection] Unable to negotiate protocol with $peerId " )
234+ log.debug(s " [Stopping Connection] Unable to negotiate protocol with {} " , peerId )
231235 context.parent ! ConnectionFailed
232236 context stop self
233237 }
234238 case None =>
235- log.debug(s " [Stopping Connection] Did not find 'Hello' in message from $peerId " )
239+ log.debug(s " [Stopping Connection] Did not find 'Hello' in message from {} " , peerId )
236240 context become awaitInitialHello(extractor, cancellableAckTimeout, seqNumber)
237241 }
238242 }
@@ -253,7 +257,7 @@ class RLPxConnectionHandler(
253257 context.parent ! MessageReceived (message)
254258
255259 case Failure (ex) =>
256- log.info(s " Cannot decode message from $peerId , because of ${ ex.getMessage} " )
260+ log.info(s " Cannot decode message from {} , because of {} " , peerId, ex.getMessage)
257261 // break connection in case of failed decoding, to avoid attack which would send us garbage
258262 context stop self
259263 }
@@ -301,7 +305,7 @@ class RLPxConnectionHandler(
301305
302306 case AckTimeout (ackSeqNumber) if cancellableAckTimeout.exists(_.seqNumber == ackSeqNumber) =>
303307 cancellableAckTimeout.foreach(_.cancellable.cancel())
304- log.debug(s " [Stopping Connection] Write to $peerId failed " )
308+ log.debug(s " [Stopping Connection] Write to {} failed " , peerId )
305309 context stop self
306310 }
307311 }
@@ -323,7 +327,7 @@ class RLPxConnectionHandler(
323327 ): Unit = {
324328 val out = messageCodec.encodeMessage(messageToSend)
325329 connection ! Write (out, Ack )
326- log.debug(s " Sent message: ${ messageToSend.underlyingMsg.toShortString} to $ peerId" )
330+ log.debug(s " Sent message: {} to {} " , messageToSend.underlyingMsg.toShortString, peerId)
327331
328332 val timeout = system.scheduler.scheduleOnce(rlpxConfiguration.waitForTcpAckTimeout, self, AckTimeout (seqNumber))
329333 context become handshaked(
@@ -347,17 +351,19 @@ class RLPxConnectionHandler(
347351
348352 def handleWriteFailed : Receive = { case CommandFailed (cmd : Write ) =>
349353 log.debug(
350- s " [Stopping Connection] Write to peer $peerId failed, trying to send ${Hex .toHexString(cmd.data.toArray[Byte ])}"
354+ s " [Stopping Connection] Write to peer {} failed, trying to send {} " ,
355+ peerId,
356+ Hex .toHexString(cmd.data.toArray[Byte ])
351357 )
352358 context stop self
353359 }
354360
355361 def handleConnectionClosed : Receive = { case msg : ConnectionClosed =>
356362 if (msg.isPeerClosed) {
357- log.debug(s " [Stopping Connection] Connection with $peerId closed by peer " )
363+ log.debug(s " [Stopping Connection] Connection with {} closed by peer " , peerId )
358364 }
359365 if (msg.isErrorClosed) {
360- log.debug(s " [Stopping Connection] Connection with $peerId closed because of error ${ msg.getErrorCause} " )
366+ log.debug(s " [Stopping Connection] Connection with {} closed because of error {} " , peerId, msg.getErrorCause)
361367 }
362368
363369 context stop self
0 commit comments