× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi,

instead of using

System.err.println("MyText");

try to use

System.out.println("MyText");



This will direct the output to the console. And this is what i do,
when i need debugging informations.

Frank






-----Ursprungliche Nachricht-----
Von: wdsc-plugin-dev-bounces@xxxxxxxxxxxx
[mailto:wdsc-plugin-dev-bounces@xxxxxxxxxxxx]Im Auftrag von Bailey Paul
Gesendet: Donnerstag, 7. August 2008 13:37
An: WDSC Plugin Developers
Betreff: [Wdsc-Plugin-Dev] Help with outputting debug info



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.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.