redux-logger icon indicating copy to clipboard operation
redux-logger copied to clipboard

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

Open husa opened this issue 7 years ago • 3 comments

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;'
    ];
  }
});

husa avatar Nov 13 '17 10:11 husa

Codecov Report

:exclamation: 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.

codecov-io avatar Nov 13 '17 10:11 codecov-io

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

husa avatar Nov 13 '17 10:11 husa

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

grushetsky avatar Mar 18 '18 03:03 grushetsky