Skip to content

policyDebug

policyDebug(c, policyName): DebugLogger

Defined in: src/policies/sdk/helpers.ts:47

Get a debug logger pre-namespaced to stoma:policy:{name}.

Returns noopDebugLogger when there is no gateway context (e.g. outside a gateway pipeline) or when debug is disabled. This eliminates the repeated getGatewayContext(c)?.debug(...) pattern.

Context

Hono request context.

string

Policy name used in the namespace.

DebugLogger

A DebugLogger — always callable, never undefined.