Skip to content
Snippets Groups Projects
Commit d12d201e authored by Aya Morisawa's avatar Aya Morisawa
Browse files

Update logger

parent c91a4c9d
No related branches found
No related tags found
No related merge requests found
......@@ -21,32 +21,33 @@ export default class Logger {
(new Logger('')).warn(message);
}
public static info(message: string): void {
(new Logger('')).info(message);
}
public static succ(message: string): void {
(new Logger('')).succ(message);
}
public static info(message: string): void {
(new Logger('')).info(message);
}
public log(level: string, message: string) {
const domain = this.domain.length > 0 ? `[${this.domain}] ` : '';
Logger.log(level, `${domain}${message}`);
}
public error(message: string): void {
public error(message: string): void { // 実行を継続できない状況で使う
this.log(chalk.red.bold('ERROR'), chalk.red.bold(message));
}
public warn(message: string): void {
public warn(message: string): void { // 実行を継続できるが改善すべき状況で使う
this.log(chalk.yellow.bold('WARN'), chalk.yellow.bold(message));
}
public info(message: string): void {
this.log(chalk.blue.bold('INFO'), message);
public succ(message: string): void { // 何かに成功した状況で使う
this.log(chalk.blue.bold('INFO'), chalk.green.bold(message));
}
public succ(message: string): void {
this.log(chalk.blue.bold('INFO'), chalk.green.bold(message));
public info(message: string): void { // それ以外
this.log(chalk.blue.bold('INFO'), message);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment