|
Hi Guys,
I am really sorry to bother you all with this, but I am trying to extend
the EditISeriesMemberCommand class so that I can intercept the
filename/connection details. I'm not a great expert in Java (more a
novice) and I hope I am on the right track. However, when I am writing
this extension, I want debug details output to System.err or a log file,
but I can't seem to find the output anywhere.
Here is the code I am trying to use: (I stripped the JavaDoc comments
from this email, because I thought it would be fairly obvious what it is
doing... but if not, then let me know)
public class VEditISeriesMemberCommand extends EditISeriesMemberCommand
{
private static Logger logger =
Logger.getLogger("net.Volvo.lpexExtensions.VEditISeriesMemberCommand");
public VEditISeriesMemberCommand() {
super();
}
public boolean doCommand(LpexView lpexView,
String parameters) {
try {
FileHandler fh = new
FileHandler("c:\\mylog.txt", true);
// Send logger output to our FileHandler.
logger.addHandler(fh);
// Request that every detail gets logged.
logger.setLevel(Level.ALL);
// Log a simple INFO message.
logger.info("=>net.Volvo.lpexExtensions.VEditISeriesMemberCommand.doComm
and");
logger.info(lpexView.query("sourceName") + "\n"
+ "-> " + lpexView.toString() +
"\n"
+ "-> " + parameters);
} catch (IOException e) {
System.err.println("Error creating logfile");
}
return super.doCommand(lpexView, parameters);
}
public static boolean openMember(LpexView lpexView,
String parameters,
boolean browse) {
try {
FileHandler fh = new
FileHandler("c:\\mylog.txt", true);
// Send logger output to our FileHandler.
logger.addHandler(fh);
// Request that every detail gets logged.
logger.setLevel(Level.ALL);
// Log a simple INFO message.
logger.info("=>net.Volvo.lpexExtensions.VEditISeriesMemberCommand.openMe
mber");
logger.info(lpexView.query("sourceName") + "\n"
+ "-> " + lpexView.toString() +
"\n"
+ "-> " + parameters + "\n"
+ "-> " + browse);
} catch (IOException e) {
System.err.println("Error creating logfile");
}
return EditISeriesMemberCommand.openMember(lpexView,
parameters, browse);
}
}
I've tried to use plain "mylog.txt" and "C:\\mylog.txt" in the
FileHandler constructor but can not find the output file in my workspace
or on my C: drive, and if I try to println all that info to System.err
then it just vanishes into the aether and I can't find that output
either (I was expecting it to go to the WDSC console view.)
How do *you* output debug information when you are writing
plugins/extensions for WDSC?
(I am using v7.0.0.6 with the included JRE and "Plug-In Dependencies")
Many thanks in advance,
Paul.
--
This is the WDSC Plugin Developers (Wdsc-Plugin-Dev) mailing list
To post a message email: Wdsc-Plugin-Dev@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/wdsc-plugin-dev
or email: Wdsc-Plugin-Dev-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/wdsc-plugin-dev.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.