Skip to content

Commit

Permalink
fix: improve clarity of "starting" logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Qu4k committed Aug 19, 2020
1 parent 2cc057f commit 1066934
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/daemon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ export class Daemon implements AsyncIterable<DenonEvent> {
const plog = log.prefix(`#${i}`);
const command = commands[i];
const options = command.options;
let process = command.exe();
plog.debug(`starting process with pid ${process.pid}`);
const last = i === commands.length - 1;

if (i === commands.length - 1) {
if (last) {
if (options.watch && this.#config.watcher.match) {
const match = this.#config.watcher.match.join(" ");
logger.info(
Expand All @@ -64,15 +63,22 @@ export class Daemon implements AsyncIterable<DenonEvent> {
`watching extensions: ${exts}`,
);
}
plog.warning(`starting main \`${command.cmd.join(" ")}\``);
plog.warning(`starting \`${command.cmd.join(" ")}\``);
} else {
plog.info(`starting sequential \`${command.cmd.join(" ")}\``);
}

let process = command.exe();
plog.debug(`starting process with pid ${process.pid}`);

if (last) {
this.#processes[process.pid] = process;
this.monitor(process, command.options);
return command.options;
} else {
await process.status();
process.close();
}

plog.info(`starting sequential \`${command.cmd.join(" ")}\``);
await process.status();
process.close();
}
return {};
}
Expand Down

0 comments on commit 1066934

Please sign in to comment.