move logger to lib/logger.js