From 78ddc9c3a30c3067459b529f912d40100c7cf7c7 Mon Sep 17 00:00:00 2001 From: Eartharoid Date: Sun, 5 May 2019 22:08:30 +0100 Subject: [PATCH] update stuff --- handlers/logger.js | 13 ++++++++++--- index.js | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/handlers/logger.js b/handlers/logger.js index 0d421c6..f88c0e7 100644 --- a/handlers/logger.js +++ b/handlers/logger.js @@ -28,9 +28,16 @@ function init(x) { }; }; try { - fs.appendFileSync(path, `Discord Tickets by Eartharoid | Log File (${d}/${('0' + now.getMonth()).slice(-2)}/${now.getFullYear()}) -->\n`, function (error) { - if (error) throw error; - }); + if(x){ + fs.appendFileSync(path, `${x} | Log File (${d}/${('0' + now.getMonth()).slice(-2)}/${now.getFullYear()}) -->\n`, function (error) { + if (error) throw error; + }); + } else { + fs.appendFileSync(path, `Log File (${d}/${('0' + now.getMonth()).slice(-2)}/${now.getFullYear()}) -->\n`, function (error) { + if (error) throw error; + }); + } + console.log(`[INFO | ${time()}] Creating new log file (${path})`); } catch(error) { console.error(leeks.colours.red(error)); diff --git a/index.js b/index.js index 15c92eb..4fdeecd 100644 --- a/index.js +++ b/index.js @@ -80,7 +80,7 @@ console.log(leeks.colours.yellow(leeks.styles.bold(homepage))); console.log('\n\n'); console.log(leeks.colours.bgGrey(leeks.colours.grey(`\n\n==========================================================================\n\n`))) console.log('\n\n'); -log.init() +log.init('DiscordTickets (bot created by Eartharoid)') // all log.* functions are logged to ./log/file.log from here onwards log.info(`Starting up...`)