1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-18 13:00:58 -05:00
Daggerbot-TS/src/helpers/Logger.ts

14 lines
370 B
TypeScript
Raw Normal View History

import moment from 'moment';
export default class Logger {
static logTime() {
return `[${moment().format('DD/MM/YY HH:mm:ss')}]`;
}
static logPrefix(prefix:string) {
return `[${prefix}]`;
}
static forwardToConsole(logType:'log'|'error', prefix:string, message:string|any) {
console[logType](this.logTime(), this.logPrefix(prefix), message);
}
}