diff --git a/lib/cmd.js b/lib/cmd.js index 12cd67b86..5b6a0242e 100644 --- a/lib/cmd.js +++ b/lib/cmd.js @@ -102,6 +102,7 @@ class Cmd { .option('--nodashboard', 'simple mode, disables the dashboard') .option('--no-color', 'no colors in case it\'s needed for compatbility purposes') .option('--logfile [logfile]', 'filename to output logs (default: none)') + .option('--logLevel [logLevel]', 'level of logging to display ["error", "warn", "info", "debug", "trace"] (default: debug)') .description('run dapp (default: development)') .action(function (env, options) { embark.run({ @@ -110,7 +111,8 @@ class Cmd { serverHost: options.host, runWebserver: !options.noserver, useDashboard: !options.nodashboard, - logfile: options.logfile + logfile: options.logfile, + logLevel: options.logLevel }); }); } diff --git a/lib/core/engine.js b/lib/core/engine.js index 9c02a5da0..1afa76d77 100644 --- a/lib/core/engine.js +++ b/lib/core/engine.js @@ -17,13 +17,14 @@ class Engine { this.interceptLogs = options.interceptLogs; this.version = options.version; this.logfile = options.logfile; + this.logLevel = options.logLevel; } init(_options) { let self = this; let options = _options || {}; this.events = new Events(); - this.logger = options.logger || new Logger({logLevel: options.logLevel || 'debug', events: this.events, logfile: this.logfile}); + this.logger = options.logger || new Logger({logLevel: options.logLevel || this.logLevel || 'debug', events: this.events, logfile: this.logfile}); this.config = new Config({env: this.env, logger: this.logger, events: this.events}); this.config.loadConfigFiles({embarkConfig: this.embarkConfig, interceptLogs: this.interceptLogs}); this.plugins = this.config.plugins; diff --git a/lib/index.js b/lib/index.js index ef0dbffa7..3e7e7ca98 100644 --- a/lib/index.js +++ b/lib/index.js @@ -61,7 +61,9 @@ class Embark { env: options.env, version: this.version, embarkConfig: options.embarkConfig || 'embark.json', - logfile: options.logfile + logfile: options.logfile, + logLevel: options.logLevel, + interceptLogs: true }); engine.init();