Skip to content

Commit 399dd35

Browse files
jdelmanimevro
authored andcommitted
fix: ignore color formatting with custom titleFormatter (#216)
1 parent 993c896 commit 399dd35

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/core.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ export function printBuffer(buffer, options) {
5050
diff,
5151
} = options;
5252

53+
const isUsingDefaultFormatter = typeof options.titleFormatter === `undefined`;
54+
5355
buffer.forEach((logEntry, key) => {
5456
const { started, startedTime, action, prevState, error } = logEntry;
5557
let { took, nextState } = logEntry;
@@ -75,10 +77,10 @@ export function printBuffer(buffer, options) {
7577
// Render
7678
try {
7779
if (isCollapsed) {
78-
if (colors.title) logger.groupCollapsed(`%c ${title}`, ...headerCSS);
80+
if (colors.title && isUsingDefaultFormatter) logger.groupCollapsed(`%c ${title}`, ...headerCSS);
7981
else logger.groupCollapsed(title);
8082
} else {
81-
if (colors.title) logger.group(`%c ${title}`, ...headerCSS);
83+
if (colors.title && isUsingDefaultFormatter) logger.group(`%c ${title}`, ...headerCSS);
8284
else logger.group(title);
8385
}
8486
} catch (e) {

0 commit comments

Comments
 (0)