UNPKG

863 BPlain TextView Raw
1import chalk from "chalk";
2
3function 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
10export default {
11 debug(...args: any[]) {
12 console.debug(logo("#777777"), ...args);
13 },
14 log(...args: any[]) {
15 // tslint:disable-next-line:no-console
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 // tslint:disable-next-line:no-console
29 return (...args: any[]) => console.log(logo(background, color), ...args);
30 },
31 logo
32};