cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From daserge <...@git.apache.org>
Subject [GitHub] cordova-cli pull request: CB-9784 Remove CLI logger levels prefixe...
Date Tue, 13 Oct 2015 15:30:45 GMT
Github user daserge commented on a diff in the pull request:

    https://github.com/apache/cordova-cli/pull/224#discussion_r41882234
  
    --- Diff: src/logger.js ---
    @@ -45,44 +46,45 @@ function formatError(error, isVerbose) {
             } else {
                 message = error.message;
             }
    +    } else {
    +        // Plain text error message
    +        message = error;
         }
     
    -    // Some error messages start with 'Error: ' prefix, so cut it off here to avoid duplication.
    -    // This will also remove generic Error.name (type), which Error.stack outputs in
verbose mode,
    -    // i.e. events.emit('error', new Error('...')), while preserving a specific Error
type like RangeError.
    -    // TODO: Update platforms code to remove such prefixes
    -    message = message && message.replace(/^error:\s+/i, '');
    -
         return message;
     }
     
     logger.log = function (logLevel, message) {
         if (this.levels[logLevel] >= this.levels[this.logLevel]) {
             var isVerbose = this.logLevel === 'verbose';
    -        var prefix = this.prefixes[logLevel] ? this.prefixes[logLevel] + ': ' : '';
    +        var cursor, output;
     
    -        if(message instanceof Error) {
    +        if(message instanceof Error || logLevel === 'error') {
    --- End diff --
    
    Yes that is correct, since `CordovaError` extends `Error`.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message