X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2FWorkerUtils.ts;h=3b90b6fb78cf301017ea746aa2fb47b7298b68e9;hb=976d11ec6d2d38a5a82440de79f059638e28cdbd;hp=7db9de9e70fb2170dde17d7fad41df7ac1047f8c;hpb=7874b0b1fbf94d34e8c65ed3e669f1c97f74dd1d;p=e-mobility-charging-stations-simulator.git diff --git a/src/worker/WorkerUtils.ts b/src/worker/WorkerUtils.ts index 7db9de9e..3b90b6fb 100644 --- a/src/worker/WorkerUtils.ts +++ b/src/worker/WorkerUtils.ts @@ -1,7 +1,15 @@ +import { threadId } from 'worker_threads'; + +import chalk from 'chalk'; + export class WorkerUtils { + private constructor() { + // This is intentional + } + public static defaultExitHandler = (code: number): void => { if (code !== 0) { - console.error(`Worker stopped with exit code ${code}`); + console.error(chalk.red(`Worker ${threadId} stopped with exit code ${code}`)); } }; }