Skip to content

Injectable logger in core #137

Description

@Bccorb

Split out of the #72 epic, which tracked it but noted it saves a new adapter no lines.

What

packages/core/src/ writes to console directly at two call sites: verifySignedAuthResponse.ts and deliverAuthMessage.ts. The adapters have their own prefixed logging ([SEAMLESS-AUTH-EXPRESS], [SEAMLESS-AUTH-FASTIFY]), and Fastify has a per-request logger on request.log that core cannot reach.

Why it matters

Serverless and edge runtimes often route logs through a platform logger rather than console, and a structured-logging setup wants these lines as events rather than strings. An adopter today cannot capture, level, or silence them.

Fastify makes the gap concrete: the adapter logs guard rejections through request.log, but anything core logs bypasses it, so one request produces log lines in two different places.

Suggested shape

An optional logger on the options core already receives, with a minimal interface (warn and error are all that is currently used), defaulting to console so nothing changes for callers that do not pass one. The epic originally listed this as DX for future adapters, which it is, but the Fastify adapter now gives it a concrete consumer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions