Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom warn implementation #1861

Open
3 tasks done
SpazzMarticus opened this issue May 22, 2024 · 0 comments
Open
3 tasks done

Allow custom warn implementation #1861

SpazzMarticus opened this issue May 22, 2024 · 0 comments
Labels
Status: Proposal Request for comments

Comments

@SpazzMarticus
Copy link

Clear and concise description of the problem

Currently all warning messages are passed to console.warn, preventing escalation to e.g. Sentry

Suggested solution

Allow users to provider a custom warning handler matching the signature of warn.

Alternative

Currently console.warn can be overridden using the [intlify] prefix as an discriminator:

const originalWarn = window.console.warn;
window.console.warn = (...args: any) => {
  if (
    args[0] &&
    typeof args[0] === 'string' &&
    args[0].startsWith('[intlify]')
  ) {
    customHandler(...args);
  }
  originalWarn(...args);
};

(Yikes!)

Additional context

No response

Validations

@SpazzMarticus SpazzMarticus added the Status: Proposal Request for comments label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Proposal Request for comments
Projects
None yet
Development

No branches or pull requests

1 participant