mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-23 05:33:08 +02:00
Use logger
This commit is contained in:
parent
112438224e
commit
6ead4d3f95
1 changed files with 3 additions and 6 deletions
|
@ -70,19 +70,16 @@ async function master(): Promise<void> {
|
|||
process.exit(1);
|
||||
}
|
||||
|
||||
const res = (t: string, c: string) =>
|
||||
console.log(chalk.bold(`--> ${(chalk as any)[c](t)}\n`));
|
||||
|
||||
switch (state) {
|
||||
case State.failed:
|
||||
res('Fatal error occurred :(', 'red');
|
||||
log('Error', chalk.red('Fatal error occurred :('));
|
||||
process.exit();
|
||||
return;
|
||||
case State.warn:
|
||||
res('Some problem(s) :|', 'yellow');
|
||||
log('Warn', chalk.yellow('Some problem(s) :|'));
|
||||
break;
|
||||
case State.success:
|
||||
res('OK :)', 'green');
|
||||
log('Info', chalk.green('OK :)'));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue