Skip to content

Commit

Permalink
Added formated date to event logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Ellen Fawkes committed Sep 15, 2017
1 parent 4d05f61 commit 5aab8c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions purrplingbot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 5aab8c6

Please sign in to comment.