Skip to content

Commit 36eccae

Browse files
authored
Add ability to have custom logger (#522)
1 parent 6cafc60 commit 36eccae

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/index.ts

+9-7
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,15 @@ export function concurrently(
113113
// keep in the list of commands to hide only strings with some length.
114114
// This might happen through the CLI when no `--hide` argument is specified, for example.
115115
const hide = _.castArray(options.hide).filter((id) => id || id === 0);
116-
const logger = new Logger({
117-
hide,
118-
prefixFormat: options.prefix,
119-
commandLength: options.prefixLength,
120-
raw: options.raw,
121-
timestampFormat: options.timestampFormat,
122-
});
116+
const logger =
117+
options.logger ||
118+
new Logger({
119+
hide,
120+
prefixFormat: options.prefix,
121+
commandLength: options.prefixLength,
122+
raw: options.raw,
123+
timestampFormat: options.timestampFormat,
124+
});
123125

124126
if (options.prefixColors === false) {
125127
logger.toggleColors(false);

0 commit comments

Comments
 (0)