Package-level declarations
Types
Materializes annotation tags as IR expressions. Resolves the required stdlib symbols (kotlin.Pair, kotlin.collections.mapOf/emptyMap) once and offers the two shapes the transformers need: a Map<String, Any> argument (buildMap, used by @Logged for Logger.logged) and a vararg tags: Pair<String, Any> argument (buildVararg, used by @Timed for Meter.timed).
The log4k Level enum, resolved once per module: its class symbol plus the entries by name. Shared by the transformers that materialize Level arguments (io.github.smyrgeorge.log4k.compiler.logged.LoggedIrTransformer and io.github.smyrgeorge.log4k.compiler.callsite.CallSiteIrTransformer).
Resolves — or synthesizes — a per-class member holding an instance of typeSymbol obtained via a companion of(KClass<*>) factory (e.g. Logger.of(this::class) / Meter.of(this::class)).
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.
Functions
buildInlineLambda wrapped in the Log4kIrFunctionExpression the transformers pass as the f argument of the inline runtime helpers (logged/measure/traced): a () -> T — or, with extensionReceiverType, an R.() -> T — carrying enclosing's original body. The moved body is reachable through Log4kIrFunctionExpression.function (e.g., to prepend statements to it).
The single dispatch-receiver parameter of this, or null (new-API parameters accessor).
The log4k member function name declared on className (dot-separated for nested classes, e.g. "Meter.Timed") with exactly regularParams regular parameters, or null when the runtime on the classpath does not provide that overload. The parameter count pins the exact overload the plugin was built against, so an unexpected runtime degrades to "not found" instead of a mis-shaped call.
The SourceLocation(file, line, function) constructor, or null on an older log4k runtime.
The instrumentation name configured on this function's annotation: its first argument (@Timed(name = …) / @Traced(name = …)) when it is a non-blank string constant, else the default qualifiedName.
Builds <Companion>.of(this::class) for a companion of(KClass<*>) factory such as Logger.of or Meter.of, using thisReceiver (a class or function dispatch receiver) as this.
Builds SourceLocation(file, line, function) for the source offset inside file — the value the instrumentation passes attach to emitted events (a call site in io.github.smyrgeorge.log4k.compiler.callsite.CallSiteIrTransformer, a function declaration in io.github.smyrgeorge.log4k.compiler.logged.LoggedIrTransformer). Returns null for synthetic offsets — there is no source position to record.
Whether this function is an eligible target for class-level instrumentation: a public, concrete member function that is not a constructor, property accessor, or inherited (fake-override) member.
Whether this function is a target of the instrumentation driven by annotation: it must have a body, not be disabled by killSwitch (on the function or its class — the per-class opt-out wins over any annotation), and either carry annotation itself or be an eligible member (see isClassLevelEligible) of a class annotated with it.
The instrumentation name of this function: "ClassName.functionName", or just the function name for a top-level function. Used as the default span name (@Traced) and the log name (@Logged).
The regular (value) parameters of this — excluding receivers and context parameters.
Reports a compilation error anchored at function, failing the build. Returns null so it can be used as ?: return messageCollector.reportError(...) from functions with a nullable return type.
Reads the tags = [Tag(key, value), …] array of annotation — parameter index 1 on @Logged, @Timed and @Traced alike — into (key, value) pairs.