diff --git a/lib/core/logger.js b/lib/core/logger.js index 361e662fa..3f44ce43c 100644 --- a/lib/core/logger.js +++ b/lib/core/logger.js @@ -3,7 +3,7 @@ let fs = require('./fs.js'); class Logger { constructor(options) { - this.events = options.events; + this.events = options.events || {emit: function(){}}; this.logLevels = ['error', 'warn', 'info', 'debug', 'trace']; this.logLevel = options.logLevel || 'info'; this.logFunction = options.logFunction || console.log; diff --git a/lib/index.js b/lib/index.js index 7ba2ce135..e08870ae0 100644 --- a/lib/index.js +++ b/lib/index.js @@ -20,7 +20,7 @@ class Embark { let Config = require('./core/config.js'); this.events = new Events(); - this.logger = new Logger({logLevel: 'debug'}); + this.logger = new Logger({logLevel: 'debug', events: this.events}); this.config = new Config({env: env, logger: this.logger, events: this.events}); this.config.loadConfigFiles(options);