Skip to content

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
Development

Successfully merging this pull request may close these issues.

3 participants