1 | const chalk = require('chalk');
|
2 | const format = require('util').format;
|
3 | const eeuiLabel = chalk.inverse("EEUI");
|
4 |
|
5 | module.exports = {
|
6 | info(msg) {
|
7 | console.log(`[${chalk.green(eeuiLabel)}] ${msg}`);
|
8 | },
|
9 |
|
10 | success(msg) {
|
11 | console.log(chalk.green(`[${eeuiLabel}] ${msg}`));
|
12 | },
|
13 |
|
14 | warn(msg) {
|
15 | console.log(chalk.yellow(`[${eeuiLabel}] ${msg}`));
|
16 | },
|
17 |
|
18 | error(...args) {
|
19 | if (args[0] instanceof Error) args[0] = args[0].message.trim();
|
20 | const msg = format.apply(format, args);
|
21 | console.log(chalk.red(`[${eeuiLabel}] ${msg}`));
|
22 | },
|
23 |
|
24 | fatal(...args) {
|
25 | if (args[0] instanceof Error) args[0] = args[0].message.trim();
|
26 | const msg = format.apply(format, args);
|
27 | console.log(chalk.red(`[${eeuiLabel}] ${msg}`));
|
28 | console.log();
|
29 | process.exit()
|
30 | },
|
31 |
|
32 | sep() {
|
33 | console.log();
|
34 | }
|
35 | };
|