diff --git a/src/handler/logger.ts b/src/handler/logger.ts index e28bc8e..5ead7f0 100644 --- a/src/handler/logger.ts +++ b/src/handler/logger.ts @@ -11,33 +11,27 @@ enum sEvent { } export default class Logger { + public log(e : T, message: string) { dayJS.extend(UTC); dayJS.extend(Timezone); dayJS.tz.guess(); - + // add colored logging? const tz = dayJS().format(); console.log(`[${`${tz}`}][${sEvent[e]}] :: ${message}`); } /** - * ┌──────────────┬─────────┐ - * │ (index) │ Values │ - * ├──────────────┼─────────┤ - * │ rss │ '50.26' │ - * │ heapTotal │ '29.15' │ - * │ heapUsed │ '12.62' │ - * │ external │ '0.84' │ - * │ arrayBuffers │ '0.10' │ - * └──────────────┴─────────┘ - * This method will print out memory usage. Optional at startup. - */ + * Utilizes console.table() to print out memory usage of current process. + * Optional at startup. + * + */ public tableRam() { console.table( Object.entries(process.memoryUsage()) .map(([k, v]: [string, number]) => { - return { [k]: ((Math.round(v) / 1024 / 1024 * 100) / 100).toFixed(2) }; + return { [k]: `${((Math.round(v) / 1024 / 1024 * 100) / 100).toFixed(2)} MBs` }; }) .reduce(((r, c) => Object.assign(r, c)), {}) ); diff --git a/src/handler/sern.ts b/src/handler/sern.ts index f6de669..ebf0a46 100644 --- a/src/handler/sern.ts +++ b/src/handler/sern.ts @@ -47,7 +47,7 @@ export class Handler { Files.buildData(this) .then(data => this.registerModules(data)) if (wrapper.init !== undefined) wrapper.init(this); - new Logger().tableRam(); + new Logger().tableRam() }) .on('messageCreate', async (message: Message) => { @@ -256,7 +256,7 @@ export interface Wrapper { } /** - * An object to be passed into Sern.Handler constructor. + * An object that gets imported and acts as a command. * @typedef {object} Module * @property {string} desc * @property {Visibility} visibility diff --git a/src/types/handler.ts b/src/types/handler.ts index 35e70b8..d1797ad 100644 --- a/src/types/handler.ts +++ b/src/types/handler.ts @@ -11,7 +11,6 @@ import type { import type * as Sern from '../handler/sern'; export type Visibility = 'private' | 'public'; - // Anything that can be sent in a `#send` or `#reply` export type possibleOutput = T | MessagePayload & MessageOptions; export type Nullable = T | null;