Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a rehash of #203 but with different logic - 203 won't work any more due to some assumptions that the log methods were only called with max 2 parameters. This uses a lot of the same browser detection logic, with the addition of node - but has a totally different method.
In short:
figure out browser support ahead of time. I've got node as not supporting colors (it does, but one would need to use ansi escape sequences which aren't really compatible with html color codes)
proxy each of the used
console
methods and pass arguments totruncateColorArguments
-if colors are supported, return arguments unchanged,
if colors aren't supported, look for any
%c
in string arguments and if found remove the number of %c found in the string from subsequent arguments - this removes the formatting information from the log.Also, fixed the CI build... it seems that someone left backticks in
./src/core.js
and eslint was complaining.