Now, I am asked to add logging function in akka's actor.
When a message is received, before it is handled, this message should be written into log. And before a message is sent out, this message should be logged first.
I think I should override the receive
and send
functions in Actor. Suppose I create a trait actorlog
which extends Actor
. And class myActor
extends actorlog
. But in myActor
, I need to override receive
function (it seems it causes problems here). So I am confused what I should do.
PS. I know akka provides logging. But now I need implement this function by myself.
receive
just for logging purposes, though it has its uses in other scenarios. – S.R.I