trait WhenEnabledLogBuilder[F[_]] extends AnyRef
A part of logging API for a specific logging level. This trait is useful in case when logging becomes expensive. It allows one to perform logging only when we need to, and not do anything when logging for specific combination of logger and logging level is turned off.
- Self Type
- WhenEnabledLogBuilder[F]
- Alphabetic
- By Inheritance
- WhenEnabledLogBuilder
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def apply(f: (LogBuilder[F]) => F[Unit]): F[Unit]
Basic building block.
Basic building block. If target combination of logger and logging level is turned off, it return immediately, otherwise it executes provided callback.
- f
callback to be used when logging is enabled
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def computeArg[T](key: String)(fv: F[T])(implicit arg0: LogEncoder[T], F: FlatMap[F]): WhenEnabledLogBuilder[F]
Extends current logging statement with structured argument.
Extends current logging statement with structured argument. This argument might be expensive to compute, so it's wrapped inside an effect. The effect is only evaluated if need, which means only when target logging level is enabled.
- T
type of structured argument. It needs to implement LogEncoder typeclass.
- key
name of the argument
- fv
value to be used as structured argument wrapped inside an effect
- returns
a new WhenEnabledLogBuilder instance that will append structured argument lazily
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def log(ex: Throwable, msg: String)(implicit location: Location): F[Unit]
Log simple message with an exception and no message specific structured argument.
Log simple message with an exception and no message specific structured argument.
- ex
exception to be logged
- msg
message to be logged
- def log(msg: String)(implicit location: Location): F[Unit]
Log simple message with no exception nor message specific structured argument.
Log simple message with no exception nor message specific structured argument.
- msg
message to be logged
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def withArg[T](key: String, value: => T)(implicit arg0: LogEncoder[T]): WhenEnabledLogBuilder[F]
Extends current logging statement with structured data.
Extends current logging statement with structured data. This is lazy variant that checks if target logging level is enabled before actually doing anything.
- T
type of structured argument. It needs to implement LogEncoder typeclass.
- key
name of the argument
- value
value to be used as structured argument
- returns
a new WhenEnabledLogBuilder instance that will append structured argument lazily