Skip to content

Refactor MetadataService to use an injected logger #751

Closed

Description

@MasterKale

Describe the issue

I haven't been all that satisfied with how MetadataService handles logging, so it's been a no-op for over two years now:

export function getLogger(_name: string): (message: string, ..._rest: unknown[]) => void {
// This is a noop for now while I search for a better debug logger technique
return (_message, ..._rest) => {};
}

I researched alternative solutions and landed on a solution: update MetadataService.initialize() to accept a new "Logger" object that allows the project using SimpleWebAuthn to capture logs appropriate to its setup, without having to accommodate any library-specific solution.

The interface would look something like this:

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

Activity

  1. added a commit that references this issue on Mar 20, 2026
    cd84b67
  2. linked a pull request that will close this issueImprove MetadataService logging #765on Aug 5, 2026
  3. added this to the v14.0.0 milestone on Aug 14, 2026
  4. MasterKale commented on Sep 2, 2026

    @MasterKale
    OwnerAuthor

    This issue has been resolved with the release of @simplewebauthn/server@14.0.0 and the new logger argument that can be provided when calling MetadataService.initialize(). See the v14.0.0 release notes for more info 🚀

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions