File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -48,21 +48,25 @@ class Logger {
48
48
* @param {RsError } rsError
49
49
*/
50
50
error ( rsError ) {
51
- const header = colors . bgRed . white . bold ( "[ERROR]" ) ;
52
51
const message = colors . red ( this . _formatMarkdown ( rsError . message ) ) ;
53
- console . error ( header , message ) ;
54
- if ( rsError . plugin ) {
55
- this . _printDetails ( rsError ) ;
52
+ if ( rsError . location ) {
53
+ for ( const loc of rsError . location ) {
54
+ const [ file , lineNumber ] = loc . split ( ":" ) ;
55
+ console . error ( file ) ;
56
+ console . error ( ` ${ lineNumber } :0` , "error" , message ) ;
57
+ }
56
58
}
57
59
}
58
60
59
61
/** @param {RsError } rsError */
60
62
warn ( rsError ) {
61
- const header = colors . bgYellow . black . bold ( "[WARNING]" ) ;
62
63
const message = colors . yellow ( this . _formatMarkdown ( rsError . message ) ) ;
63
- console . error ( header , message ) ;
64
- if ( rsError . plugin ) {
65
- this . _printDetails ( rsError ) ;
64
+ if ( rsError . location ) {
65
+ for ( const loc of rsError . location ) {
66
+ const [ file , lineNumber ] = loc . split ( ":" ) ;
67
+ console . error ( file ) ;
68
+ console . error ( ` ${ lineNumber } :0` , "warning" , message ) ;
69
+ }
66
70
}
67
71
}
68
72
You can’t perform that action at this time.
0 commit comments