From 6ead4d3f95880f31bc95afa435689f26efdf6db4 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Thu, 29 Dec 2016 19:06:41 +0900 Subject: [PATCH] Use logger --- src/index.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/index.ts b/src/index.ts index 2efeb47e51..e5171a38f6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -70,19 +70,16 @@ async function master(): Promise { 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; }