mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-18 13:00:58 -05:00
14 lines
370 B
TypeScript
14 lines
370 B
TypeScript
|
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);
|
||
|
}
|
||
|
}
|