Skip to content

Commit

Permalink
fix: ignore color formatting with custom titleFormatter (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdelman authored and imevro committed Mar 30, 2017
1 parent 993c896 commit 399dd35
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export function printBuffer(buffer, options) {
diff,
} = options;

const isUsingDefaultFormatter = typeof options.titleFormatter === `undefined`;

buffer.forEach((logEntry, key) => {
const { started, startedTime, action, prevState, error } = logEntry;
let { took, nextState } = logEntry;
Expand All @@ -75,10 +77,10 @@ export function printBuffer(buffer, options) {
// Render
try {
if (isCollapsed) {
if (colors.title) logger.groupCollapsed(`%c ${title}`, ...headerCSS);
if (colors.title && isUsingDefaultFormatter) logger.groupCollapsed(`%c ${title}`, ...headerCSS);
else logger.groupCollapsed(title);
} else {
if (colors.title) logger.group(`%c ${title}`, ...headerCSS);
if (colors.title && isUsingDefaultFormatter) logger.group(`%c ${title}`, ...headerCSS);
else logger.group(title);
}
} catch (e) {
Expand Down

0 comments on commit 399dd35

Please sign in to comment.