consola
consola copied to clipboard
Doesn't handle native console string substitutions.
Version
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).
and %c
too
Yeah, actually all strings substitutions. Changing the title for more generic.
@d34thwings I think #66 fixed that, right?