[logback-dev] svn commit: r1458 - logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views
noreply.seb at qos.ch
noreply.seb at qos.ch
Mon Mar 26 20:32:56 CEST 2007
Author: seb
Date: Mon Mar 26 20:32:56 2007
New Revision: 1458
Modified:
logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/LoggingEventLabelProvider.java
Log:
Now displaying ERROR messages in red and WARN messages in dark orange
Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/LoggingEventLabelProvider.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/LoggingEventLabelProvider.java (original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/LoggingEventLabelProvider.java Mon Mar 26 20:32:56 2007
@@ -36,6 +36,7 @@
private PatternLayout patternLayout;
private Color cachedRed;
+ private Color cachedOrange;
private Color cachedBlack;
private Color cachedWhite;
private Color cachedGray;
@@ -49,6 +50,7 @@
createDefaultPatternLayout();
Display display = Display.getCurrent();
cachedRed = Display.getCurrent().getSystemColor(SWT.COLOR_RED);
+ cachedOrange = new Color(display, 255, 140, 0);
cachedBlack = Display.getCurrent().getSystemColor(SWT.COLOR_BLACK);
cachedWhite = Display.getCurrent().getSystemColor(SWT.COLOR_WHITE);
cachedGray = new Color(display, 240, 240, 240);
@@ -134,8 +136,10 @@
public Color getForeground(Object element, int columnIndex) {
LoggingEvent event = (LoggingEvent) element;
- if (event.getLevel().isGreaterOrEqual(Level.WARN)) {
+ if (event.getLevel().equals(Level.ERROR)) {
return cachedRed;
+ } else if (event.getLevel().equals(Level.WARN)) {
+ return cachedOrange;
} else {
return cachedBlack;
}
@@ -145,5 +149,7 @@
public void dispose() {
super.dispose();
stackImage.dispose();
+ cachedGray.dispose();
+ cachedOrange.dispose();
}
}
\ No newline at end of file
More information about the logback-dev
mailing list