From 9bb52fcc8f603a12e1c35846cb74e6f5d7b4be62 Mon Sep 17 00:00:00 2001 From: tgpethan Date: Sat, 4 Jan 2020 12:27:12 +0000 Subject: [PATCH] Add some more comments to the consoleHelper --- modules/consoleHelper.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/consoleHelper.js b/modules/consoleHelper.js index c0f2c48..451f9ba 100644 --- a/modules/consoleHelper.js +++ b/modules/consoleHelper.js @@ -19,17 +19,21 @@ if (!fs.existsSync(__dirname + BASE_PATH + "/config.json")) { console.log(`[consoleHelper] Made consoleHelper config file`); } +// Load in config const config = require(__dirname + BASE_PATH + "/config.json"); module.exports = { + // Prints a bit of information to the console printInfo:function(emoji, s) { console.log(chalk.green(`[${this.getTime24()}] `)+chalk.bgGreen(chalk.black(" INFO "))+` ${emoji} ${s}`); }, + // Prints a warning to the console printWarn:function(emoji, s) { console.warn(chalk.green(`[${this.getTime24()}] `)+chalk.bgYellow(chalk.black(" WARN "))+` ${emoji} ${s}`); }, + // Prints an error to the console printError:function(emoji, s) { console.error(chalk.green(`[${this.getTime24()}] `)+chalk.bgRed(chalk.black(" ERROR "))+` ${emoji} ${s}`); }, @@ -46,6 +50,7 @@ module.exports = { } }, + // Function for converting 24 hour to 12 hour time t2412:function(inp) { // Check what time it is, AM or PM. if (parseInt(inp.split(":")[0]) > 11) {