You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gr...@apache.org on 2023/09/30 17:48:40 UTC
[logging-chainsaw] branch master updated (6827a45 -> 6c7228a)
This is an automated email from the ASF dual-hosted git repository.
grobmeier pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/logging-chainsaw.git
from 6827a45 converted variable to local
new 09d3243 removed: unused method doLoadColorSettings
new 6c7228a removed: unused addRules, removeRule, COLORS_EXTENSION
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../apache/log4j/chainsaw/color/RuleColorizer.java | 61 +++-------------------
1 file changed, 6 insertions(+), 55 deletions(-)
[logging-chainsaw] 01/02: removed: unused method doLoadColorSettings
Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
grobmeier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-chainsaw.git
commit 09d3243f8dbbbb0b28342013a59bd0ff5a15df17
Author: Christian Grobmeier <cg...@grobmeier.de>
AuthorDate: Sat Sep 30 19:47:49 2023 +0200
removed: unused method doLoadColorSettings
---
.../apache/log4j/chainsaw/color/RuleColorizer.java | 33 ----------------------
1 file changed, 33 deletions(-)
diff --git a/src/main/java/org/apache/log4j/chainsaw/color/RuleColorizer.java b/src/main/java/org/apache/log4j/chainsaw/color/RuleColorizer.java
index fff4137..13d2fa0 100644
--- a/src/main/java/org/apache/log4j/chainsaw/color/RuleColorizer.java
+++ b/src/main/java/org/apache/log4j/chainsaw/color/RuleColorizer.java
@@ -285,39 +285,6 @@ public class RuleColorizer implements Colorizer {
setRules(newRules);
}
- private boolean doLoadColorSettings(String name) {
- //first attempt to load encoded file
- File f = new File(SettingsManager.getInstance().getSettingsDirectory(), URLEncoder.encode(name) + COLORS_EXTENSION);
-
- if (f.exists()) {
- ObjectInputStream s = null;
-
- try {
- s = new ObjectInputStream(
- new BufferedInputStream(new FileInputStream(f)));
-
- Map map = (Map) s.readObject();
-// setRules(map);
- } catch (EOFException eof) { //end of file - ignore..
- } catch (IOException ioe) {
- ioe.printStackTrace();
- //unable to load file - delete it
- f.delete();
- } catch (ClassNotFoundException cnfe) {
- cnfe.printStackTrace();
- } finally {
- if (s != null) {
- try {
- s.close();
- } catch (IOException ioe) {
- ioe.printStackTrace();
- }
- }
- }
- }
- return f.exists();
- }
-
public static List<Color> getDefaultColors() {
List<Color> vec = new ArrayList<>();
[logging-chainsaw] 02/02: removed: unused addRules, removeRule, COLORS_EXTENSION
Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
grobmeier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-chainsaw.git
commit 6c7228a2b02e5bcb13937347bec7f0dba98d6498
Author: Christian Grobmeier <cg...@grobmeier.de>
AuthorDate: Sat Sep 30 19:48:34 2023 +0200
removed: unused addRules, removeRule, COLORS_EXTENSION
---
.../apache/log4j/chainsaw/color/RuleColorizer.java | 28 +++++-----------------
1 file changed, 6 insertions(+), 22 deletions(-)
diff --git a/src/main/java/org/apache/log4j/chainsaw/color/RuleColorizer.java b/src/main/java/org/apache/log4j/chainsaw/color/RuleColorizer.java
index 13d2fa0..d79bc50 100644
--- a/src/main/java/org/apache/log4j/chainsaw/color/RuleColorizer.java
+++ b/src/main/java/org/apache/log4j/chainsaw/color/RuleColorizer.java
@@ -17,24 +17,22 @@
package org.apache.log4j.chainsaw.color;
+import org.apache.commons.configuration2.AbstractConfiguration;
+import org.apache.commons.configuration2.DataConfiguration;
import org.apache.log4j.chainsaw.ChainsawConstants;
+import org.apache.log4j.chainsaw.logevents.ChainsawLoggingEvent;
import org.apache.log4j.chainsaw.prefs.SettingsManager;
import org.apache.log4j.rule.ColorRule;
import org.apache.log4j.rule.ExpressionRule;
import org.apache.log4j.rule.Rule;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import java.awt.*;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
-import java.io.*;
-import java.net.URLEncoder;
-import java.util.*;
+import java.util.ArrayList;
import java.util.List;
-import org.apache.commons.configuration2.AbstractConfiguration;
-import org.apache.commons.configuration2.DataConfiguration;
-import org.apache.log4j.chainsaw.logevents.ChainsawLoggingEvent;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
/**
@@ -56,8 +54,6 @@ public class RuleColorizer implements Colorizer {
private AbstractConfiguration configuration;
private final boolean isGlobal;
- private static final String COLORS_EXTENSION = ".colors";
-
private static final Color WARN_DEFAULT_COLOR = new Color(255, 255, 153);
private static final Color FATAL_OR_ERROR_DEFAULT_COLOR = new Color(255, 153, 153);
private static final Color MARKER_DEFAULT_COLOR = new Color(153, 255, 153);
@@ -129,14 +125,6 @@ public class RuleColorizer implements Colorizer {
return rules;
}
- public void addRules(List<ColorRule> newRules) {
- rules.addAll( newRules );
-
- colorChangeSupport.firePropertyChange(PROPERTY_CHANGED_COLORRULE, false, true);
-
- saveColorSettings();
- }
-
public void addRule(ColorRule rule) {
rules.add(rule);
@@ -145,10 +133,6 @@ public class RuleColorizer implements Colorizer {
saveColorSettings();
}
- public void removeRule(String expression) {
- rules.removeIf( x -> x.getExpression().equals( expression ) );
- }
-
/**
* {{@inheritDoc}
*/