psmith 2004/05/14 23:32:44
Modified: src/java/org/apache/log4j/chainsaw LogUI.java
Log:
added tiny bit of code to start the VFS Plugin using reflection, if and only
if the class can be found on the classpath. This gets around conditions
where VFS and it's dependencies are not available.
Revision Changes Path
1.94 +11 -0 logging-log4j/src/java/org/apache/log4j/chainsaw/LogUI.java
Index: LogUI.java
===================================================================
RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/LogUI.java,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -r1.93 -r1.94
--- LogUI.java 14 May 2004 03:21:13 -0000 1.93
+++ LogUI.java 15 May 2004 06:32:44 -0000 1.94
@@ -361,6 +361,17 @@
ChainsawCentral cc = new ChainsawCentral();
pluginRegistry.addPlugin(cc);
cc.activateOptions();
+
+// TODO this should also be fixed up, as VFS bits and pieces might not be built
in an Ant build when they don't have all the VFS jars local
+ try {
+ Class vfsPluginClass =
Class.forName("org.apache.log4j.chainsaw.vfs.VFSPlugin");
+ Plugin vfsPlugin = (Plugin) vfsPluginClass.newInstance();
+ vfsPlugin.activateOptions();
+ pluginRegistry.addPlugin(vfsPlugin);
+ MessageCenter.getInstance().getLogger().info("Looks like VFS is available...
WooHoo!");
+ } catch (Throwable e) {
+ MessageCenter.getInstance().getLogger().error("Doesn't look like VFS is
available", e);
+ }
}
private void setupReceiverPanel() {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]