Skip to content

@adrianhall/cloudflare-toolkit


@adrianhall/cloudflare-toolkit / index / resolveLoggerConfig

Function: resolveLoggerConfig()

resolveLoggerConfig(environment, runtime): ResolvedLoggerConfig

Defined in: src/lib/logging/resolve.ts:45

Resolve a { level, transport } configuration for the given environment and runtime.

Each call creates a fresh transport instance. If you call this helper more than once with the same arguments you will receive independent transport instances, which is intentional for test isolation.

Unknown or undefined environments are treated as "production".

Parameters

environment

Environment | undefined

One of "test", "development", "production", or any other string. undefined maps to production behavior.

runtime

Runtime

Either "browser" or "worker".

Returns

ResolvedLoggerConfig

A fresh ResolvedLoggerConfig ready to pass to createLogger.