Packages

trait FlowLogger extends SLF4JLoggerAPI[CorePredicate, FlowMethod] with UnderlyingMixin with MarkerMixin with EntryTransformMixin with EventBufferMixin with OnConditionMixin

This trait implements a logger that is used for rendering entry/exit logging wrappers.

The FlowMethod implements the bulk of the logic here, and is intended to be used with a user-provided FlowBehavior that determines what statements and side effects happen on entry and exit.

If logging is enabled, then the execution is wrapped to capture the result or execution, and then the result is returned or execution rethrown. If the logging level is not enabled or logging execution is denied by a filter, then execution of the block still proceeds but is not wrapped by a Try block.

You should use Condition.never explicitly here to disable logging, as it will shortcut to a Noop implementation. Benchmarks show a noop flow takes 42ns to execute, 4.5ns if you remove sourcecode.Args from the method signature.

import com.tersesystems.blindsight._
import com.tersesystems.blindsight.flow._

implicit def flowBehavior[B: ToArgument]: FlowBehavior[B] = new SimpleFlowBehavior
val logger = LoggerFactory.getLogger
val flowLogger: FlowLogger = logger.flow
val resultIsThree: Int = flowLogger.trace(1 + 2)
Source
FlowLogger.scala
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FlowLogger
  2. OnConditionMixin
  3. ConditionMixin
  4. EventBufferMixin
  5. EntryTransformMixin
  6. MarkerMixin
  7. UnderlyingMixin
  8. SLF4JLoggerAPI
  9. Error
  10. Warn
  11. Info
  12. Debug
  13. Trace
  14. SLF4JLoggerComponent
  15. AnyRef
  16. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. type Method = FlowMethod
    Definition Classes
    FlowLoggerSLF4JLoggerComponent
  2. type Predicate = CorePredicate
    Definition Classes
    FlowLoggerSLF4JLoggerComponent
  3. type Self = FlowLogger

Abstract Value Members

  1. abstract def debug: Method
    Definition Classes
    Debug
  2. abstract def error: Method
    Definition Classes
    Error
  3. abstract def info: Method
    Definition Classes
    Info
  4. abstract def isDebugEnabled: Predicate
    Definition Classes
    Debug
  5. abstract def isErrorEnabled: Predicate
    Definition Classes
    Error
  6. abstract def isInfoEnabled: Predicate
    Definition Classes
    Info
  7. abstract def isTraceEnabled: Predicate
    Definition Classes
    Trace
  8. abstract def isWarnEnabled: Predicate
    Definition Classes
    Warn
  9. abstract def markers: Markers

    Returns the accumulated markers of this logger.

    Returns the accumulated markers of this logger.

    returns

    the accumulated markers, may be Markers.empty.

    Definition Classes
    MarkerMixin
  10. abstract def trace: Method
    Definition Classes
    Trace
  11. abstract def underlying: org.slf4j.Logger
    Definition Classes
    UnderlyingMixin
  12. abstract def warn: Method
    Definition Classes
    Warn
  13. abstract def withCondition(condition: Condition): Self

    Returns a new instance of the logger that will only log if the condition is met.

    Returns a new instance of the logger that will only log if the condition is met.

    Definition Classes
    ConditionMixin
  14. abstract def withEntryTransform(f: (Entry) => Entry): Self
    Definition Classes
    EntryTransformMixin
  15. abstract def withEntryTransform(level: Level, f: (Entry) => Entry): Self
    Definition Classes
    EntryTransformMixin
  16. abstract def withEventBuffer(level: Level, buffer: EventBuffer): Self
    Definition Classes
    EventBufferMixin
  17. abstract def withEventBuffer(buffer: EventBuffer): Self
    Definition Classes
    EventBufferMixin
  18. abstract def withMarker[T](instance: T)(implicit arg0: ToMarkers[T]): Self

    Returns a logger which will always render with the given marker.

    Returns a logger which will always render with the given marker.

    T

    the instance type.

    instance

    a type class instance of ToMarkers

    returns

    a new instance of the logger that has this marker.

    Definition Classes
    MarkerMixin

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from FlowLogger toany2stringadd[FlowLogger] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (FlowLogger, B)
    Implicit
    This member is added by an implicit conversion from FlowLogger toArrowAssoc[FlowLogger] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  8. def ensuring(cond: (FlowLogger) => Boolean, msg: => Any): FlowLogger
    Implicit
    This member is added by an implicit conversion from FlowLogger toEnsuring[FlowLogger] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (FlowLogger) => Boolean): FlowLogger
    Implicit
    This member is added by an implicit conversion from FlowLogger toEnsuring[FlowLogger] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: => Any): FlowLogger
    Implicit
    This member is added by an implicit conversion from FlowLogger toEnsuring[FlowLogger] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): FlowLogger
    Implicit
    This member is added by an implicit conversion from FlowLogger toEnsuring[FlowLogger] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from FlowLogger toStringFormat[FlowLogger] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  21. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  22. def toString(): String
    Definition Classes
    AnyRef → Any
  23. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  24. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated
  2. def onCondition(condition: Condition): Self

    Returns a new instance of the logger that will only log if the condition is met.

    Returns a new instance of the logger that will only log if the condition is met.

    Definition Classes
    OnConditionMixin
    Annotations
    @deprecated
    Deprecated

    (Since version 1.4.0) Use withCondition

  3. def [B](y: B): (FlowLogger, B)
    Implicit
    This member is added by an implicit conversion from FlowLogger toArrowAssoc[FlowLogger] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from OnConditionMixin

Inherited from ConditionMixin

Inherited from EventBufferMixin

Inherited from EntryTransformMixin

Inherited from MarkerMixin

Inherited from UnderlyingMixin

Inherited from Error[CorePredicate, FlowMethod]

Inherited from Warn[CorePredicate, FlowMethod]

Inherited from Info[CorePredicate, FlowMethod]

Inherited from Debug[CorePredicate, FlowMethod]

Inherited from Trace[CorePredicate, FlowMethod]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd fromFlowLogger to any2stringadd[FlowLogger]

Inherited by implicit conversion StringFormat fromFlowLogger to StringFormat[FlowLogger]

Inherited by implicit conversion Ensuring fromFlowLogger to Ensuring[FlowLogger]

Inherited by implicit conversion ArrowAssoc fromFlowLogger to ArrowAssoc[FlowLogger]

Ungrouped