Improved logger.js