From faabec3924413f18394b552ee56107ad8679bcb9 Mon Sep 17 00:00:00 2001 From: ricklon Date: Sat, 14 May 2011 10:23:05 -0400 Subject: [PATCH] Fixed an issue of log4j creating extra instances. Derive all logger from Base.class.getName() static instance. Also, turned debugging on for Mac OS X version. Former-commit-id: d386510c471dbdb91e200eac37146ac2652f6036 --- app/src/processing/app/Base.java | 2 +- app/src/processing/app/debug/Compiler.java | 10 ++++------ build/build.xml | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 550d2f7da..8f046af8a 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -122,7 +122,7 @@ static public void main(String args[]) { try { BasicConfigurator.configure(); Logger.getRootLogger().setLevel(Level.DEBUG); - logger.debug("DEBUG: Logging enabled."); + logger.debug("DEBUG: Logging enabled." + Base.class.getName()); File versionFile = getContentFile("lib/version.txt"); diff --git a/app/src/processing/app/debug/Compiler.java b/app/src/processing/app/debug/Compiler.java index 93cc39924..2c4da8569 100755 --- a/app/src/processing/app/debug/Compiler.java +++ b/app/src/processing/app/debug/Compiler.java @@ -42,7 +42,7 @@ public class Compiler implements MessageConsumer { - static Logger logger = Logger.getLogger(Compiler.class.getName()); + static Logger logger = Logger.getLogger(Base.class.getName()); static final String BUGS_URL = "http://code.google.com/p/arduino/issues/list"; static final String SUPER_BADNESS = "Compiler error, please submit this code to " @@ -70,9 +70,7 @@ public class Compiler implements MessageConsumer { ArrayList includePaths; public Compiler() { - //BasicConfigurator.configure(); - //Logger.getRootLogger().setLevel(Level.DEBUG); - //logger.debug("DEBUG: Compiler.java: Logging enabled."); + logger.debug("DEBUG: Compiler.java: Logging on."); } @@ -90,6 +88,8 @@ public Compiler() { * Only if there's a problem. Only then. */ public boolean compile(Sketch sketch, String buildPath,String primaryClassName, boolean verbose) throws RunnerException { + logger.debug("DEBUG: Compiler.java: Start Compile(...)."); + this.sketch = sketch; this.buildPath = buildPath; this.primaryClassName = primaryClassName; @@ -534,9 +534,7 @@ ArrayList getIncludes(String corePath) includePaths.add(corePath); for (File file : sketch.getImportedLibraries()) { - //includePaths.add(file.getPath()); includePaths.add(file.getPath()); - } return includePaths; } diff --git a/build/build.xml b/build/build.xml index be87dce5e..46e525cc4 100755 --- a/build/build.xml +++ b/build/build.xml @@ -221,7 +221,7 @@ - +