File tree 3 files changed +75
-6
lines changed
3 files changed +75
-6
lines changed Original file line number Diff line number Diff line change 74
74
}
75
75
}
76
76
},
77
+ "colors" : [
78
+ {
79
+ "id" : " magentoLogViewer.errorColor" ,
80
+ "description" : " Color for error log entries" ,
81
+ "defaults" : {
82
+ "dark" : " #f14c4c" ,
83
+ "light" : " #cd3131" ,
84
+ "highContrast" : " #ff0000"
85
+ }
86
+ },
87
+ {
88
+ "id" : " magentoLogViewer.warningColor" ,
89
+ "description" : " Color for warning log entries" ,
90
+ "defaults" : {
91
+ "dark" : " #cca700" ,
92
+ "light" : " #ff8f00" ,
93
+ "highContrast" : " #ffd700"
94
+ }
95
+ },
96
+ {
97
+ "id" : " magentoLogViewer.debugColor" ,
98
+ "description" : " Color for debug log entries" ,
99
+ "defaults" : {
100
+ "dark" : " #ffeb3b" ,
101
+ "light" : " #ffd700" ,
102
+ "highContrast" : " #ffff00"
103
+ }
104
+ },
105
+ {
106
+ "id" : " magentoLogViewer.infoColor" ,
107
+ "description" : " Color for info log entries" ,
108
+ "defaults" : {
109
+ "dark" : " #3794ff" ,
110
+ "light" : " #0078d4" ,
111
+ "highContrast" : " #0099ff"
112
+ }
113
+ },
114
+ {
115
+ "id" : " magentoLogViewer.criticalColor" ,
116
+ "description" : " Color for critical log entries" ,
117
+ "defaults" : {
118
+ "dark" : " #ff1493" ,
119
+ "light" : " #ff1493" ,
120
+ "highContrast" : " #ff69b4"
121
+ }
122
+ }
123
+ ],
77
124
"viewsContainers" : {
78
125
"activitybar" : [
79
126
{
Original file line number Diff line number Diff line change @@ -215,12 +215,19 @@ export function getLineCount(filePath: string): number {
215
215
216
216
// Returns the appropriate icon for the given log level.
217
217
export function getIconForLogLevel ( level : string ) : vscode . ThemeIcon {
218
- switch ( level ) {
219
- case 'ERROR' : return new vscode . ThemeIcon ( 'error' ) ;
220
- case 'WARN' : return new vscode . ThemeIcon ( 'warning' ) ;
221
- case 'DEBUG' : return new vscode . ThemeIcon ( 'debug' ) ;
222
- case 'INFO' : return new vscode . ThemeIcon ( 'info' ) ;
223
- default : return new vscode . ThemeIcon ( 'circle-outline' ) ;
218
+ switch ( level . toUpperCase ( ) ) {
219
+ case 'CRITICAL' :
220
+ return new vscode . ThemeIcon ( 'error' , new vscode . ThemeColor ( 'magentoLogViewer.criticalColor' ) ) ;
221
+ case 'ERROR' :
222
+ return new vscode . ThemeIcon ( 'error' , new vscode . ThemeColor ( 'magentoLogViewer.errorColor' ) ) ;
223
+ case 'WARN' :
224
+ return new vscode . ThemeIcon ( 'warning' , new vscode . ThemeColor ( 'magentoLogViewer.warningColor' ) ) ;
225
+ case 'DEBUG' :
226
+ return new vscode . ThemeIcon ( 'debug' , new vscode . ThemeColor ( 'magentoLogViewer.debugColor' ) ) ;
227
+ case 'INFO' :
228
+ return new vscode . ThemeIcon ( 'info' , new vscode . ThemeColor ( 'magentoLogViewer.infoColor' ) ) ;
229
+ default :
230
+ return new vscode . ThemeIcon ( 'circle-outline' ) ;
224
231
}
225
232
}
226
233
Original file line number Diff line number Diff line change @@ -327,6 +327,21 @@ export class LogItem extends vscode.TreeItem {
327
327
super ( label , collapsibleState as vscode . TreeItemCollapsibleState ) ;
328
328
this . description = this . label . match ( / \( \d + \) / ) ?. [ 0 ] || '' ;
329
329
this . label = this . label . replace ( / \( \d + \) / , '' ) . trim ( ) ;
330
+
331
+ // Füge Farben basierend auf Log-Level hinzu
332
+ if ( this . label . includes ( 'ERROR' ) ) {
333
+ this . tooltip = 'Error Message' ;
334
+ this . resourceUri = vscode . Uri . parse ( 'error' ) ;
335
+ } else if ( this . label . includes ( 'WARN' ) ) {
336
+ this . tooltip = 'Warning Message' ;
337
+ this . resourceUri = vscode . Uri . parse ( 'warning' ) ;
338
+ } else if ( this . label . includes ( 'DEBUG' ) ) {
339
+ this . tooltip = 'Debug Message' ;
340
+ this . resourceUri = vscode . Uri . parse ( 'debug' ) ;
341
+ } else if ( this . label . includes ( 'INFO' ) ) {
342
+ this . tooltip = 'Info Message' ;
343
+ this . resourceUri = vscode . Uri . parse ( 'info' ) ;
344
+ }
330
345
}
331
346
332
347
contextValue = 'logItem' ;
You can’t perform that action at this time.
0 commit comments