final class LogSelector[F[_]] extends AnyVal
It helps to add logging capability to components allowing
them to use a LogWriter[F] if in scope or defaulting, when
F[_] is an Applicative, to noOpLog[F] if no LogWriter is
provided.
Example:
def create[F[_]: LogSelector](a: String): ALoggingClient[F] = new ALoggingClient[F] { def do = LogSelector[F].writer.info("something") }
def useTheClient[F[_]](address: String): F[Unit] = {
implicit val logger: LogWriter[F] = consoleLog[F]
create[F](address)
}
will log using logger
def useTheClient[F[_]](address: String): F[Unit] = create[F](address) will not log
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- LogSelector
- AnyVal
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Instance Constructors
- new LogSelector(log: LogWriter[F])
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val log: LogWriter[F]
- def toString(): String
- Definition Classes
- Any