trait
LogSource
[-T]
extends AnyRef
Abstract Value Members
-
def
genString
(t: T): String
Concrete Value Members
-
def
!=
(arg0: AnyRef): Boolean
-
def
!=
(arg0: Any): Boolean
-
def
##
(): Int
-
def
==
(arg0: AnyRef): Boolean
-
def
==
(arg0: Any): Boolean
-
def
asInstanceOf
[T0]
: T0
-
def
clone
(): AnyRef
-
def
eq
(arg0: AnyRef): Boolean
-
def
equals
(arg0: Any): Boolean
-
def
finalize
(): Unit
-
def
genString
(t: T, system: ActorSystem): String
-
def
getClass
(): java.lang.Class[_]
-
def
getClazz
(t: T): Class[_]
-
def
hashCode
(): Int
-
def
isInstanceOf
[T0]
: Boolean
-
def
ne
(arg0: AnyRef): Boolean
-
def
notify
(): Unit
-
def
notifyAll
(): Unit
-
def
synchronized
[T0]
(arg0: ⇒ T0): T0
-
def
toString
(): String
-
def
wait
(): Unit
-
def
wait
(arg0: Long, arg1: Int): Unit
-
def
wait
(arg0: Long): Unit
Inherited from AnyRef
Inherited from Any
This trait defines the interface to be provided by a “log source formatting rule” as used by akka.event.Logging’s
apply/createmethod.See the companion object for default implementations.
Example:
trait MyType { // as an example def name: String } implicit val myLogSourceType: LogSource[MyType] = new LogSource { def genString(a: MyType) = a.name } class MyClass extends MyType { val log = Logging(eventStream, this) // will use "hallo" as logSource def name = "hallo" }The second variant is used for including the actor system’s address:
trait MyType { // as an example def name: String } implicit val myLogSourceType: LogSource[MyType] = new LogSource { def genString(a: MyType) = a.name def genString(a: MyType, s: ActorSystem) = a.name + "," + s } class MyClass extends MyType { val sys = ActorSyste("sys") val log = Logging(sys, this) // will use "hallo,akka://sys" as logSource def name = "hallo" }The default implementation of the second variant will just call the first.