- Notifications
You must be signed in to change notification settings - Fork317
Truncate colors if not supported#279
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
codecov-io commentedDec 20, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report
@@ Coverage Diff @@## master #279 +/- ##========================================= Coverage ? 78.88% ========================================= Files ? 6 Lines ? 180 Branches ? 0 ========================================= Hits ? 142 Misses ? 38 Partials ? 0
Continue to review full report at Codecov.
|
Uh oh!
There was an error while loading.Please reload this page.
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
consolemethods and pass arguments totruncateColorArguments-if colors are supported, return arguments unchanged,
if colors aren't supported, look for any
%cin 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.jsand eslint was complaining.