redux-logger
redux-logger copied to clipboard
Fix #264: Add support of styling custom `titleFormatter`
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 Report
:exclamation: No coverage uploaded for pull request base (
master@539dab5
). Click here to learn what that means. The diff coverage is0%
.
@@ 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.
@evgenyrodionov for some reason, "codecov" can't find latest coverage report from master
. Maybe it's because Travis build is failing on master
.
@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.