Github user vladimir-kotikov commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/405#discussion_r55035943 --- Diff: cordova-common/src/CordovaLogger.js --- @@ -153,6 +153,30 @@ CordovaLogger.prototype.setLevel = function (logLevel) { }; /** + * Adjusts the current logger level according to the passed options. + * + * @param {Object|Array} opts An object or args array with options + * + * @return {CordovaLogger} Current instance, to allow calls chaining. + */ +CordovaLogger.prototype.adjustLoggerLevel = function (opts) { + if (opts instanceof Array) { + opts.silent = opts.indexOf('--silent') !== -1; + opts.verbose = opts.indexOf('--verbose') !== -1 || opts.indexOf('-d') !== -1; + } + + if (opts.silent) { + this.setLevel('error'); + } + + if (opts.verbose || opts.d) { --- End diff -- I think that `opts.d` is not needed because nopt converts `-d` to `{verbose: true}` if `-d` is a shortcut for `-verbose`
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org