Skip to main content
Version: Current

runLoggerTck

@rotorsoft/act-root


@rotorsoft/act-root / act-tck/src / runLoggerTck

Function: runLoggerTck()

runLoggerTck(options): void

Defined in: libs/act-tck/src/logger-tck.ts:51

Runs the Logger contract test compatibility kit against the implementation produced by options.factory.

The Logger contract is intentionally narrow: implementations are pluggable wrappers around pino, winston, bunyan, console, etc. The TCK verifies the shape of the contract, not the format of the output (which is adapter-specific by design):

  • every level method exists and is callable in both overload forms (msg) and (obj, msg?)
  • child(bindings) returns something that satisfies the same contract and can itself spawn children
  • level is a non-empty string
  • dispose is awaitable and idempotent
  • cyclic payloads must not throw (sinks may choose any fallback)

Anything more (output format, level gating, color, file routing) is adapter-specific and stays in the adapter's own test suite.

Parametersโ€‹

optionsโ€‹

LoggerTckOptions

Returnsโ€‹

void

Exampleโ€‹

import { runLoggerTck } from "@rotorsoft/act-tck";
import { ConsoleLogger } from "@rotorsoft/act";

runLoggerTck({
name: "ConsoleLogger",
factory: () => new ConsoleLogger({ level: "trace" }),
});