c

com.digitalasset.canton.logging

NamedLoggingContext

final case class NamedLoggingContext(loggerFactory: NamedLoggerFactory, traceContext: TraceContext) extends Product with Serializable

Enriches a com.digitalasset.canton.tracing.TraceContext with a NamedLoggerFactory. This allows to pass a NamedLoggerFactory into methods that themselves do not have a NamedLoggerFactory in scope on their own, e.g., because they live inside a static object or in pure data classes.

The logging methods of this class include the class's or object's name in the logger name. To that end, the class or object should extend HasLoggerName. This ensures that the logger's name in the log file is close to where the log message was actually created.

See also

NamedLogging.namedLoggingContext for implicitly creating this from the NamedLoggerFactory of the caller

ErrorLoggingContext for a variant that fixes the logger name to the caller

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NamedLoggingContext
  2. Serializable
  3. Product
  4. Equals
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new NamedLoggingContext(loggerFactory: NamedLoggerFactory, traceContext: TraceContext)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. def debug(message: String, throwable: Throwable)(implicit loggerNameFromClass: LoggerNameFromClass): Unit
  7. def debug(message: String)(implicit loggerNameFromClass: LoggerNameFromClass): Unit
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def error(message: String, throwable: Throwable)(implicit loggerNameFromClass: LoggerNameFromClass): Unit
  10. def error(message: String)(implicit loggerNameFromClass: LoggerNameFromClass): Unit
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  12. def info(message: String, throwable: Throwable)(implicit loggerNameFromClass: LoggerNameFromClass): Unit
  13. def info(message: String)(implicit loggerNameFromClass: LoggerNameFromClass): Unit
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. val loggerFactory: NamedLoggerFactory
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. def productElementNames: Iterator[String]
    Definition Classes
    Product
  20. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  21. def trace(message: String, throwable: Throwable)(implicit loggerNameFromClass: LoggerNameFromClass): Unit
  22. def trace(message: String)(implicit loggerNameFromClass: LoggerNameFromClass): Unit

    Log something using the captured trace context

  23. val traceContext: TraceContext
  24. def tracedLogger(implicit loggerClass: LoggerNameFromClass): TracedLogger

    Log something using a different trace context

  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  27. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  28. def warn(message: String, throwable: Throwable)(implicit loggerNameFromClass: LoggerNameFromClass): Unit
  29. def warn(message: String)(implicit loggerNameFromClass: LoggerNameFromClass): Unit

Deprecated Value Members

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

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped