cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-10791) Add adjustLoggerLevel to cordova-common.CordovaLogger
Date Fri, 04 Mar 2016 14:32:40 GMT

    [ https://issues.apache.org/jira/browse/CB-10791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15179947#comment-15179947
] 

ASF GitHub Bot commented on CB-10791:
-------------------------------------

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`


> Add adjustLoggerLevel to cordova-common.CordovaLogger
> -----------------------------------------------------
>
>                 Key: CB-10791
>                 URL: https://issues.apache.org/jira/browse/CB-10791
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: CordovaCommon
>            Reporter: Sergey Shakhnazarov
>            Assignee: Sergey Shakhnazarov
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message