@@ -8,7 +8,7 @@ import { ApexLog, parse } from '../parsers/ApexLogParser.js';
88import { hostService } from '../services/VSCodeService.js' ;
99import { globalStyles } from '../styles/global.styles.js' ;
1010import './AppHeader.js' ;
11- import { Notification } from './notifications/NotificationPanel.js' ;
11+ import { Notification , type NotificationSeverity } from './notifications/NotificationPanel.js' ;
1212
1313@customElement ( 'log-viewer' )
1414export class LogViewer extends LitElement {
@@ -90,13 +90,15 @@ export class LogViewer extends LitElement {
9090
9191 const localNotifications = Array . from ( this . notifications ) ;
9292 apexLog . logIssues . forEach ( ( element ) => {
93- const severity = element . type === 'error' ? 'Error' : 'Warning' ;
93+ const severity = this . toSeverity ( element . type ) ;
9494
9595 const logMessage = new Notification ( ) ;
9696 logMessage . summary = element . summary ;
9797 logMessage . message = element . description ;
9898 logMessage . severity = severity ;
9999 localNotifications . push ( logMessage ) ;
100+
101+ console . debug ( 's,' , severity , logMessage ) ;
100102 } ) ;
101103 this . notifications = localNotifications ;
102104
@@ -135,6 +137,15 @@ export class LogViewer extends LitElement {
135137 }
136138 }
137139
140+ severity = new Map < string , NotificationSeverity > ( [
141+ [ 'error' , 'Error' ] ,
142+ [ 'unexpected' , 'Warning' ] ,
143+ [ 'skip' , 'Info' ] ,
144+ ] ) ;
145+ private toSeverity ( errorType : 'unexpected' | 'error' | 'skip' ) {
146+ return this . severity . get ( errorType ) || 'Info' ;
147+ }
148+
138149 private parserIssuesToMessages ( apexLog : ApexLog ) {
139150 const issues : Notification [ ] = [ ] ;
140151 apexLog . parsingErrors . forEach ( ( message ) => {
@@ -150,7 +161,6 @@ export class LogViewer extends LitElement {
150161 > report unsupported type</ a
151162 > `
152163 : message . slice ( message . indexOf ( ':' ) + 1 ) ;
153- logMessage . severity = 'Info' ;
154164 issues . push ( logMessage ) ;
155165 } ) ;
156166 return issues ;
0 commit comments