TracingSymbols

The log4k tracing symbols the transformers correlate logs and spans with, resolved once per module: TracingContext (plus its currentOrNull()) and TracingEvent.Span. Each is null when the runtime on the classpath predates it — callers degrade gracefully.

Shared by io.github.smyrgeorge.log4k.compiler.callsite.CallSiteIrTransformer, io.github.smyrgeorge.log4k.compiler.logged.LoggedIrTransformer and io.github.smyrgeorge.log4k.compiler.trace.TraceIrTransformer.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val currentOrNull: IrSimpleFunctionSymbol?

TracingContext.currentOrNull() — the active span of a context, or null.

Link copied to clipboard
val span: IrClassSymbol?

TracingEvent.Span — a span in scope, attached or used as a parent directly.

Link copied to clipboard
val tracingContext: IrClassSymbol?

TracingContext — a context parameter/receiver of this type provides the active span.

Functions

Link copied to clipboard
fun irCurrentOrNull(builder: IrBuilderWithScope, receiver: IrExpression): IrExpression?

Builds <receiver>.currentOrNull() — the active span of the TracingContext yielded by receiver — or null when currentOrNull is unresolved.