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

Doesn't handle native console string substitutions. #62

Closed
mathieutu opened this issue Aug 6, 2019 · 3 comments
Closed

Doesn't handle native console string substitutions. #62

mathieutu opened this issue Aug 6, 2019 · 3 comments

Comments

@mathieutu
Copy link

Version

v2.10.0

Reproduction link

https://codesandbox.io/embed/fervent-pine-su2ty

Steps to reproduce

Hi folks,

Consola is not handling the native string substitutions of console.
https://developer.mozilla.org/en-US/docs/Web/API/console#Using_string_substitutions

This leads to issues when when using wrapConsole method in code bases where you don't control logs.

Example: there is a problem with all the react errors.

Here an example before/after the wrap:

- Warning: Received `true` for a non-boolean attribute `secondary`.
+ Warning: Received `%s` for a non-boolean attribute `%s`.
  
- If you want to write it to the DOM, pass a string instead: secondary="true" or secondary={value.toString()}.
+ If you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.%s true secondary secondary true secondary 
    in h1 (created by App)
    in div (created by App)
    in App

For me, consola should have the same api than console, to be able to replace it properly.

How can we handle that?

Thanks for your work,
Matt'.

What is expected ?

Consola should have at least the same api and features than console.

What is actually happening?

Features from console are missing in consola (browser and node).

This bug report is available on Nuxt community (#c57)
@ghost ghost added the cmty:bug-report label Aug 6, 2019
@NomNes
Copy link

NomNes commented Aug 6, 2019

and %c too

@mathieutu mathieutu changed the title Doesn't handle native "%s" console formatting. Doesn't handle native console string substitutions. Aug 6, 2019
@mathieutu
Copy link
Author

Yeah, actually all strings substitutions.
Changing the title for more generic.

@mathieutu
Copy link
Author

@D34THWINGS I think #66 fixed that, right?

@pi0 pi0 closed this as completed Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants