trait
Logging[+T <: Logger] extends AnyRef
Abstract Value Members
-
abstract
val
loggerFactory: LoggerFactory[T]
Concrete Value Members
-
final
def
!=(arg0: AnyRef): Boolean
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: AnyRef): Boolean
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
lazy val
log: T
-
implicit
val
messageGatherer: ((PrintWriter) ⇒ Unit) ⇒ Message
-
final
def
ne(arg0: AnyRef): Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
implicit
val
stringFnToMessage: (⇒ String) ⇒ Message
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
implicit
val
throwableToMessage: (Throwable) ⇒ Message
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
Inherited from AnyRef
Inherited from Any
This is a convenient way to expose a log member to classes that need to log and pull in the implicits that are needed for normal logging patterns. Note that implementing this trait directly necessitates implementing the "loggerFactory" member. In a typical application, you would extend this trait with an application-specific subclass that defines the LoggerFactory in use by your application.
Note that this creates a per-instance Logger field, even though all the fields should point to the same Logger. If you have a ton of instances for a particular class and want to keep the memory footprint as small as possible, you may want to explicitly refer to a field in a companion object (which can implement this trait). In that case, you'll probably have to import the Logging implicits explicitly.