generated from garrettmills/template-npm-typescript
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.
30 lines
672 B
30 lines
672 B
import * as clc from 'cli-color'
|
|
|
|
export abstract class Logger {
|
|
private static verbose = false
|
|
|
|
public static setVerbosity(verbose: boolean) {
|
|
this.verbose = verbose
|
|
}
|
|
|
|
public static info(...out: any) {
|
|
this.log(clc.blue('info '), ...out)
|
|
}
|
|
|
|
public static error(...out: any) {
|
|
this.log(clc.red('error '), ...out)
|
|
}
|
|
|
|
public static success(...out: any) {
|
|
this.log(clc.green('success '), ...out)
|
|
}
|
|
|
|
public static verb(...out: any) {
|
|
this.log(clc.italic('verb '), ...out)
|
|
}
|
|
|
|
private static log(...out: any) {
|
|
console.log(...out) // eslint-disable-line no-console
|
|
}
|
|
}
|