1 | import chalk from "chalk";
|
2 |
|
3 | function logo(background: string = "#FB249D", color: string = "#ffffff") {
|
4 | if (!chalk.supportsColor) {
|
5 | return "{ cotype:";
|
6 | }
|
7 | return chalk.bgHex(background)(chalk.hex(color)(chalk.bold(" { ")));
|
8 | }
|
9 |
|
10 | export default {
|
11 | debug(...args: any[]) {
|
12 | console.debug(logo("#777777"), ...args);
|
13 | },
|
14 | log(...args: any[]) {
|
15 |
|
16 | console.log(logo("#555555"), ...args);
|
17 | },
|
18 | warn(...args: any[]) {
|
19 | console.warn(logo("#f9a022"), ...args);
|
20 | },
|
21 | error(...args: any[]) {
|
22 | console.warn(logo("#f94622"), ...args);
|
23 | },
|
24 | info(...args: any[]) {
|
25 | console.debug(logo(), ...args);
|
26 | },
|
27 | color(background: string = "#FB249D", color: string = "#ffffff") {
|
28 |
|
29 | return (...args: any[]) => console.log(logo(background, color), ...args);
|
30 | },
|
31 | logo
|
32 | };
|