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

Fix #264: Add support of styling custom titleFormatter #265

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

husa
Copy link

@husa husa commented Nov 13, 2017

Fix #264 : Right now, there's no way to style console output with css when using custom titleFormatter.

This PR adds ability to return Array from titleFormatter that will be spread when passed to logger.
Eg. support this:

createLogger({
  titleFormatter (action, time, took) {
    return [
      `%caction %c${action.type} %c@ ${time} %c(in ${took.toFixed(2)})`,
      'color: gray; font-weight: lighter;',
      'color: red;',
      'color: blue; font-weight: lighter;',
      'color: green; font-weight: lighter;'
    ];
  }
});

@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@539dab5). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #265   +/-   ##
=========================================
  Coverage          ?   81.45%           
=========================================
  Files             ?        5           
  Lines             ?      151           
  Branches          ?        0           
=========================================
  Hits              ?      123           
  Misses            ?       28           
  Partials          ?        0
Impacted Files Coverage Δ
src/core.js 72.36% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 539dab5...92cddfc. Read the comment docs.

@husa
Copy link
Author

husa commented Nov 13, 2017

@evgenyrodionov for some reason, "codecov" can't find latest coverage report from master. Maybe it's because Travis build is failing on master.

@grushetsky
Copy link
Collaborator

@husa, the custom styling of log messages is going to be refactored in the next version of Redux Logger. You can read more about it in the issue #292.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants