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

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

Github user nikhilkh commented on a diff in the pull request:

    https://github.com/apache/cordova-cli/pull/224#discussion_r41881734
  
    --- 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 --
    
    If am assuming `CordovaError` is included in the check for instanceof 
`Error`


> Remove CLI logger levels prefixes
> ---------------------------------
>
>                 Key: CB-9784
>                 URL: https://issues.apache.org/jira/browse/CB-9784
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CLI
>            Reporter: Sergey Shakhnazarov
>            Assignee: Sergey Shakhnazarov
>
> EventEmitter usage provides info on an event level so the prefixing may be 
> superfluous taking into account we have coloring distinction for event levels.



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

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

Reply via email to