My I suggest that System.out lines be replaced with appropriate log4j
statements in OpenJUMP?
One of the purposes/advantages of using log4j is that I can filter
output generated by other people's plugins that don't pertain to my own
development.
Attached is a couple of example patches that I've had to make to
OpenJUMP so as to not clutter my console.
If someone wouldn't mind applying these small patches, that would be great!
Cheers,
Kevin
### Eclipse Workspace Patch 1.0
#P openjump-core
Index: src/com/vividsolutions/jump/workbench/imagery/ecw/ECWImageFactory.java
===================================================================
--- src/com/vividsolutions/jump/workbench/imagery/ecw/ECWImageFactory.java
(revision 2016)
+++ src/com/vividsolutions/jump/workbench/imagery/ecw/ECWImageFactory.java
(working copy)
@@ -31,6 +31,8 @@
* (250)385-6040
* www.vividsolutions.com
*/
+import org.apache.log4j.Logger;
+
import com.vividsolutions.jump.I18N;
import com.vividsolutions.jump.JUMPException;
import com.vividsolutions.jump.workbench.WorkbenchContext;
@@ -41,6 +43,8 @@
*/
public class ECWImageFactory implements ReferencedImageFactory {
+ private Logger logger = Logger.getLogger(ECWImageFactory.class);
+
public static final String TYPE_NAME = "ECW";
final static String
sNotInstalled=I18N.get("org.openjump.core.ui.plugin.layer.AddSIDLayerPlugIn.not-installed");
@@ -75,10 +79,10 @@
}catch(ClassNotFoundException e){
// eat it
- System.out.println("ECW loader class " +
JNCSRendererProxy.RENDERER_CLASS + " " + sNotInstalled);
+ logger.warn("ECW loader class " +
JNCSRendererProxy.RENDERER_CLASS + " " + sNotInstalled);
return false;
}
- System.out.println("found ECW loader class");
+ logger.trace("found ECW loader class");
return c != null;
}
Index:
src/com/vividsolutions/jump/workbench/imagery/mrsid/MrSIDImageFactory.java
===================================================================
--- src/com/vividsolutions/jump/workbench/imagery/mrsid/MrSIDImageFactory.java
(revision 2016)
+++ src/com/vividsolutions/jump/workbench/imagery/mrsid/MrSIDImageFactory.java
(working copy)
@@ -33,6 +33,8 @@
*/
import java.io.File;
+import org.apache.log4j.Logger;
+
import com.vividsolutions.jump.I18N;
import com.vividsolutions.jump.JUMPException;
import com.vividsolutions.jump.workbench.WorkbenchContext;
@@ -40,6 +42,9 @@
import com.vividsolutions.jump.workbench.imagery.ReferencedImageFactory;
public class MrSIDImageFactory implements ReferencedImageFactory {
+
+ private Logger logger = Logger.getLogger(MrSIDImageFactory.class);
+
//[sstein 19Apr2008] -- new
public static String WORKING_DIR;
public static String ETC_PATH;
@@ -102,7 +107,7 @@
//-- error messages can not be send, as the workbench does not
exist yet
//context.getWorkbench().getFrame().warnUser(sErrorSeeOutputWindow);
//context.getWorkbench().getFrame().getOutputFrame().addText(MRSIDDECODE + " "
+ sNotInstalled);
- System.out.println(MRSIDDECODE + " " + sNotInstalled);
+ logger.warn(MRSIDDECODE + " " + sNotInstalled);
return false;
}
@@ -111,10 +116,10 @@
//-- error messages can not be send, as the workbench does not
exist yet
//context.getWorkbench().getFrame().warnUser(sErrorSeeOutputWindow);
//context.getWorkbench().getFrame().getOutputFrame().addText(MRSIDINFO + " " +
sNotInstalled);
- System.out.println(MRSIDINFO + " " + sNotInstalled);
+ logger.warn(MRSIDINFO + " " + sNotInstalled);
return false;
}
- System.out.println("found Mrsid decode files");
+ logger.trace("found Mrsid decode files");
return true;
//-- end new stuff
// }catch(IOException e){
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel