Skip to content

Commit

Permalink
Add ability to have custom logger (#522)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwood23 authored Dec 31, 2024
1 parent 6cafc60 commit 36eccae
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,15 @@ export function concurrently(
// keep in the list of commands to hide only strings with some length.
// This might happen through the CLI when no `--hide` argument is specified, for example.
const hide = _.castArray(options.hide).filter((id) => id || id === 0);
const logger = new Logger({
hide,
prefixFormat: options.prefix,
commandLength: options.prefixLength,
raw: options.raw,
timestampFormat: options.timestampFormat,
});
const logger =
options.logger ||
new Logger({
hide,
prefixFormat: options.prefix,
commandLength: options.prefixLength,
raw: options.raw,
timestampFormat: options.timestampFormat,
});

if (options.prefixColors === false) {
logger.toggleColors(false);
Expand Down

0 comments on commit 36eccae

Please sign in to comment.