You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
465 B
26 lines
465 B
|
4 years ago
|
const chalk = require('chalk');
|
||
|
|
const log = console.log;
|
||
|
|
|
||
|
|
export function bindInfo(onLog) {
|
||
|
|
return (message: string) => {
|
||
|
|
onLog && onLog(message);
|
||
|
|
info(message);
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
export function info(info: string) {
|
||
|
|
log(chalk.bold.blue(info));
|
||
|
|
}
|
||
|
|
|
||
|
|
export function error(info: string) {
|
||
|
|
log(chalk.bold.red(info));
|
||
|
|
}
|
||
|
|
|
||
|
|
export function warn(info: string) {
|
||
|
|
log(chalk.bold.yellow(info));
|
||
|
|
}
|
||
|
|
|
||
|
|
export function success(info: string) {
|
||
|
|
log(chalk.bold.green(info));
|
||
|
|
}
|