Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
tswaters wants to merge3 commits intoLogRocket:master
base:master
Choose a base branch
Loading
fromtswaters:master

Conversation

@tswaters
Copy link

@tswaterstswaters commentedDec 20, 2017
edited
Loading

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 usedconsole 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.

sergeysova reacted with thumbs up emoji
@codecov-io
Copy link

codecov-io commentedDec 20, 2017
edited
Loading

Codecov Report

❗ No coverage uploaded for pull request base (master@c8b4971).Click here to learn what that means.
The diff coverage is64.51%.

Impacted file tree graph

@@            Coverage Diff            @@##             master     #279   +/-   ##=========================================  Coverage          ?   78.88%           =========================================  Files             ?        6             Lines             ?      180             Branches          ?        0           =========================================  Hits              ?      142             Misses            ?       38             Partials          ?        0
Impacted FilesCoverage Δ
src/core.js72% <0%> (ø)
src/defaults.js77.77% <100%> (ø)
src/logger.js65.51% <65.51%> (ø)

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last updatec8b4971...aa95bd4. Read thecomment docs.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@tswaters@codecov-io

[8]ページ先頭

©2009-2025 Movatter.jp