Added timestamps to console log

This commit is contained in:
AlexKvazos
2015-05-12 19:41:58 -05:00
parent cab42eebc5
commit c0cf956710
3 changed files with 10 additions and 2 deletions
+4 -1
View File
@@ -1,12 +1,15 @@
import mineflayer from 'mineflayer';
import moment from 'moment';
import events from '../../bot';
module.exports = (socket) => {
function onConnection(data) {
let timestamp = moment().format('MMM D h:mm:ss a');
// log activity to console
console.log(`connecting > ${data.hostname}:${data.port} - ${data.username}`);
console.log(`${timestamp}: connecting > ${data.hostname}:${data.port} - ${data.username}`);
// inform user that connection is being made