Github user tillrohrmann commented on a diff in the pull request: https://github.com/apache/flink/pull/917#discussion_r35215346 --- Diff: flink-runtime/src/main/scala/org/apache/flink/runtime/FlinkActor.scala --- @@ -19,34 +19,30 @@ package org.apache.flink.runtime import _root_.akka.actor.Actor - -/** - * Mixin to add debug message logging - */ -trait ActorLogMessages { - that: Actor with ActorSynchronousLogging => - - override def receive: Receive = new Actor.Receive { - private val _receiveWithLogMessages = receiveWithLogMessages - - override def isDefinedAt(x: Any): Boolean = _receiveWithLogMessages.isDefinedAt(x) - - override def apply(x: Any): Unit = { - if (!log.isDebugEnabled) { - _receiveWithLogMessages(x) - } - else { - log.debug(s"Received message $x at ${that.self.path} from ${that.sender()}.") - - val start = System.nanoTime() - - _receiveWithLogMessages(x) - - val duration = (System.nanoTime() - start) / 1000000 - log.debug(s"Handled message $x in $duration ms from ${that.sender()}.") - } - } +import grizzled.slf4j.Logger + +/** Base trait for Flink's actors. + * + * The message handling logic is defined in the handleMessage method. This allows to mixin + * stackable traits which change the message receiving behaviour. + */ +trait FlinkActor extends Actor { + lazy val log = Logger(getClass) --- End diff -- Yes it is used by the subclasses of `FlinkActor`. By initializing the logger lazily, we achieve that the logger gets the right class name from the implementing subclass. But we can also define it abstractly so that the implementing subclass has to define it.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---