aztec
Version:
Node Js Framework for creating API Services
28 lines (20 loc) • 568 B
text/typescript
import 'colors';
export class Handler {
static env: string = 'development';
static error(err) {
if (this.env === 'development' || this.env === 'test') throw new Error(`${err}`);
}
static warning(warn) {
if (this.env === 'development') {
console.log('');
console.warn(`AZTEC Warning: ${warn}`.yellow);
console.log('');
}
}
static info(info) {
if (this.env === 'development') console.info('AZTEC Info: ' + info.blue);
}
static userError(err) {
if (this.env === 'development') throw new Error(`${err}`);
}
}