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
367 B
TypeScript
Raw Normal View History

2023-10-07 17:01:16 -04:00
import dayjs from 'dayjs';
export default class Logger {
static logTime() {
2023-10-07 17:01:16 -04:00
return `[${dayjs().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);
}
}