Skip to content

Improve MetadataService logging#765

Draft
MasterKale wants to merge 6 commits into
milestone/v14.0.0from
feat/improved-metadataservice-logging
Draft

Improve MetadataService logging#765
MasterKale wants to merge 6 commits into
milestone/v14.0.0from
feat/improved-metadataservice-logging

Conversation

@MasterKale
Copy link
Copy Markdown
Owner

@MasterKale MasterKale commented May 27, 2026

This PR introduces a new logger argument to MetadataService.initialize(). This argument is of type SimpleWebAuthnLogger, which is a simple object of logging methods:

export interface SimpleWebAuthnLogger {
  debug: (message: string, ...args: unknown[]) => void;
  info: (message: string, ...args: unknown[]) => void;
  warn: (message: string, ...args: unknown[]) => void;
  error: (message: string, ...args: unknown[]) => void;
}

The intention is that projects using SimpleWebAuthn can define an instance of this interface that logs the message and arbitrary arguments in a way that makes sense for that project. This eliminates any SimpleWebAuthn-specific logging concerns that led to the old implementation getting ripped out of this project.

Right now only MetadataService will make use of this new logging pattern.

Fixes #751

@MasterKale MasterKale added the package:server @simplewebauthn/server label May 27, 2026
@MasterKale MasterKale added this to the v14.0.0 milestone May 27, 2026
@MasterKale
Copy link
Copy Markdown
Owner Author

Marking WIP for now until I write some tests. I'm otherwise happy with the current implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package:server @simplewebauthn/server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant