Skip to content

Commit f873b74

Browse files
committed
Revert "ETCM-671: replaced actor logging with normal logging"
This reverts commit f8a0631.
1 parent b904b91 commit f873b74

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/main/scala/io/iohk/ethereum/blockchain/sync/regular/BlockFetcher.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
package io.iohk.ethereum.blockchain.sync.regular
22

33
import akka.actor.Status.Failure
4-
import akka.actor.{Actor, ActorRef, Props}
4+
import akka.actor.{Actor, ActorLogging, ActorRef, Props}
55
import akka.pattern.{ask, pipe}
66
import akka.util.{ByteString, Timeout}
77
import cats.data.NonEmptyList
88
import cats.instances.option._
99
import cats.syntax.either._
10+
import io.iohk.ethereum.consensus.validators.BlockValidator
1011
import io.iohk.ethereum.blockchain.sync.PeersClient._
1112
import io.iohk.ethereum.blockchain.sync.regular.BlockFetcherState.{
1213
AwaitingBodiesToBeIgnored,
1314
AwaitingHeadersToBeIgnored
1415
}
1516
import io.iohk.ethereum.blockchain.sync.regular.BlockImporter.{ImportNewBlock, NotOnTop, OnTop}
1617
import io.iohk.ethereum.blockchain.sync.regular.RegularSync.ProgressProtocol
17-
import io.iohk.ethereum.consensus.validators.BlockValidator
1818
import io.iohk.ethereum.crypto.kec256
1919
import io.iohk.ethereum.domain._
2020
import io.iohk.ethereum.network.PeerEventBusActor.PeerEvent.MessageFromPeer
2121
import io.iohk.ethereum.network.PeerEventBusActor.SubscriptionClassifier.MessageClassifier
2222
import io.iohk.ethereum.network.PeerEventBusActor.{PeerSelector, Subscribe, Unsubscribe}
2323
import io.iohk.ethereum.network.PeerId
24+
import io.iohk.ethereum.network.p2p.messages.{Codes, CommonMessages, PV64}
2425
import io.iohk.ethereum.network.p2p.messages.PV62._
2526
import io.iohk.ethereum.network.p2p.messages.PV63.{GetNodeData, NodeData}
26-
import io.iohk.ethereum.network.p2p.messages.{Codes, CommonMessages, PV64}
27+
import io.iohk.ethereum.utils.ByteStringUtils
2728
import io.iohk.ethereum.utils.Config.SyncConfig
2829
import io.iohk.ethereum.utils.FunctorOps._
29-
import io.iohk.ethereum.utils.{ByteStringUtils, Logger}
3030
import monix.eval.Task
3131
import monix.execution.{Scheduler => MonixScheduler}
3232
import mouse.all._
@@ -40,7 +40,7 @@ class BlockFetcher(
4040
val syncConfig: SyncConfig,
4141
val blockValidator: BlockValidator
4242
) extends Actor
43-
with Logger {
43+
with ActorLogging {
4444

4545
import BlockFetcher._
4646

@@ -368,7 +368,7 @@ class BlockFetcher(
368368
.tap(blacklistPeerOnFailedRequest)
369369
.flatMap(handleRequestResult(responseFallback))
370370
.onErrorHandle { error =>
371-
log.error("Unexpected error while doing a request", error)
371+
log.error(error, "Unexpected error while doing a request")
372372
responseFallback
373373
}
374374

@@ -384,7 +384,7 @@ class BlockFetcher(
384384
case NoSuitablePeer =>
385385
Task.now(fallback).delayExecution(syncConfig.syncRetryInterval)
386386
case Failure(cause) =>
387-
log.error("Unexpected error on the request result", cause)
387+
log.error(cause, "Unexpected error on the request result")
388388
Task.now(fallback)
389389
case m =>
390390
Task.now(m)

src/main/scala/io/iohk/ethereum/blockchain/sync/regular/BlockImporter.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.iohk.ethereum.blockchain.sync.regular
22

33
import akka.actor.Actor.Receive
4-
import akka.actor.{Actor, ActorRef, NotInfluenceReceiveTimeout, Props, ReceiveTimeout}
4+
import akka.actor.{Actor, ActorLogging, ActorRef, NotInfluenceReceiveTimeout, Props, ReceiveTimeout}
55
import akka.util.ByteString
66
import cats.data.NonEmptyList
77
import cats.implicits._
@@ -17,7 +17,7 @@ import io.iohk.ethereum.network.PeerId
1717
import io.iohk.ethereum.ommers.OmmersPool.AddOmmers
1818
import io.iohk.ethereum.transactions.PendingTransactionsManager
1919
import io.iohk.ethereum.transactions.PendingTransactionsManager.{AddUncheckedTransactions, RemoveTransactions}
20-
import io.iohk.ethereum.utils.{ByteStringUtils, Logger}
20+
import io.iohk.ethereum.utils.ByteStringUtils
2121
import io.iohk.ethereum.utils.Config.SyncConfig
2222
import io.iohk.ethereum.utils.FunctorOps._
2323
import monix.eval.Task
@@ -37,7 +37,7 @@ class BlockImporter(
3737
checkpointBlockGenerator: CheckpointBlockGenerator,
3838
supervisor: ActorRef
3939
) extends Actor
40-
with Logger {
40+
with ActorLogging {
4141
import BlockImporter._
4242

4343
implicit val ec: Scheduler = Scheduler(context.dispatcher)
@@ -247,7 +247,7 @@ class BlockImporter(
247247
informFetcherOnFail: Boolean,
248248
internally: Boolean
249249
): ImportFn = {
250-
def doLog(entry: ImportMessages.LogEntry): Unit = log.info(entry._2)//log.log(entry._1, entry._2)
250+
def doLog(entry: ImportMessages.LogEntry): Unit = log.log(entry._1, entry._2)
251251
importWith(
252252
{
253253
Task(doLog(importMessages.preImport()))
@@ -305,7 +305,7 @@ class BlockImporter(
305305

306306
importTask
307307
.map(self ! ImportDone(_, blockImportType))
308-
.onErrorHandle(ex => log.error(ex.getMessage, ex))
308+
.onErrorHandle(ex => log.error(ex, ex.getMessage))
309309
.timed
310310
.map { case (timeTaken, _) => blockImportType.recordMetric(timeTaken.length) }
311311
.runAsyncAndForget

0 commit comments

Comments
 (0)