Added logger and changed all console.log to use the new logger.