diff --git a/src/handler/logger.ts b/src/handler/logger.ts index 61f0051..6be2d35 100644 --- a/src/handler/logger.ts +++ b/src/handler/logger.ts @@ -1,17 +1,31 @@ -import dayjs from 'dayjs'; -import timezone from 'dayjs/plugin/timezone'; -import utc from 'dayjs/plugin/timezone'; +import dayJS from 'dayjs'; +import Timezone from 'dayjs/plugin/timezone'; +import UTC from 'dayjs/plugin/timezone'; enum sEvent { - TEXT_CMD, GLOBAL_SLASH, LOCAL_SLASH, - DM, + DM, CRASH, + TEXT_CMD, } -class Logger { +export default class Logger { public log(e : T, message: string) { - console.log(`[${'ISOSTRING (todo) '}][${sEvent[e]}] :: ${message}`); + dayJS.extend(UTC); + dayJS.extend(Timezone); + dayJS.tz.guess(); + + const tz = dayJS().format(); + console.log(`[${`${tz}`}][${sEvent[e]}] :: ${message}`); } -} + + public tableRam() { + throw Error('unimpl'); + + console.table( + Object.values(process.memoryUsage()) + .map(([k,v]) => { return {[k] : `${(Math.round(v) / 1024 / 1024 * 100) / 100}`} }) + .reduce(((r, c) => Object.assign(r, c)), {})) + } +} \ No newline at end of file diff --git a/src/handler/sern.ts b/src/handler/sern.ts index 98a0352..c6e211d 100644 --- a/src/handler/sern.ts +++ b/src/handler/sern.ts @@ -2,19 +2,11 @@ import * as Files from './utilities/readFile'; import type * as Utils from './utilities/preprocessors/args'; import type { -<<<<<<< HEAD Arg, Context, Visibility, possibleOutput -} from '../Types/Handler'; -======= - Arg, - Context, - Visibility, - possibleOutput } from '../types/handler'; ->>>>>>> ad86658e11a26d01e86d1a83e0bbcecef57d3001 import type { ApplicationCommandOptionData, @@ -28,7 +20,6 @@ import { Ok, Result, None, Some } from 'ts-results'; import { isBot, hasPrefix, fmt } from './utilities/messageHelpers'; import Logger from './logger'; - /** * @class */