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
- Alphabetic
- By Inheritance
- NamedLoggingContext
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new NamedLoggingContext(loggerFactory: NamedLoggerFactory, traceContext: TraceContext)
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() @HotSpotIntrinsicCandidate()
- def debug(message: String, throwable: Throwable)(implicit loggerNameFromClass: LoggerNameFromClass): Unit
- def debug(message: String)(implicit loggerNameFromClass: LoggerNameFromClass): Unit
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def error(message: String, throwable: Throwable)(implicit loggerNameFromClass: LoggerNameFromClass): Unit
- def error(message: String)(implicit loggerNameFromClass: LoggerNameFromClass): Unit
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def info(message: String, throwable: Throwable)(implicit loggerNameFromClass: LoggerNameFromClass): Unit
- def info(message: String)(implicit loggerNameFromClass: LoggerNameFromClass): Unit
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val loggerFactory: NamedLoggerFactory
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def trace(message: String, throwable: Throwable)(implicit loggerNameFromClass: LoggerNameFromClass): Unit
- def trace(message: String)(implicit loggerNameFromClass: LoggerNameFromClass): Unit
Log something using the captured trace context
- val traceContext: TraceContext
- def tracedLogger(implicit loggerClass: LoggerNameFromClass): TracedLogger
Log something using a different trace context
- 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()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def warn(message: String, throwable: Throwable)(implicit loggerNameFromClass: LoggerNameFromClass): Unit
- def warn(message: String)(implicit loggerNameFromClass: LoggerNameFromClass): Unit