From 5aab8c665d901973e5568b59d87a56fcd45c1173 Mon Sep 17 00:00:00 2001 From: Ellen Fawkes Date: Fri, 15 Sep 2017 15:20:19 +0200 Subject: [PATCH] Added formated date to event logger --- purrplingbot.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/purrplingbot.js b/purrplingbot.js index cb15df6..e928fe0 100644 --- a/purrplingbot.js +++ b/purrplingbot.js @@ -258,8 +258,9 @@ function log_event(msg, type = "Bot", level = "INFO") { return; } if (level == "DEBUG" && DEBUG < 1) return; - channel.send(`Event: _${level}_ - **${type}** - ${msg}`) - .then(logger.info(`Event log ${type}::"${msg}" sent to #${channel.name} level: ${level}`)) + let timestamp = moment(new Date()).format("MM/DD HH:mm:ss"); + channel.send(`${timestamp}: _${level}_ - **${type}** - ${msg}`) + .then(logger.info(`Event log ${type} - "${msg}" sent to #${channel.name} level: ${level}`)) .catch(logger.error); }