DecoderPro®

Advanced

Other Apps

Tools

JMRI provides powerful tools for working with your layout.

Layout Automation

JMRI can be used to automate parts of your layout, from simply controlling a crossing gate to running trains in the background.

JMRI: DecoderPro User Guide

Debugging

While the program is running

While the program is running, debugging information is printed to "standard output", which is in different places depending on what operating system you're using and how you started the program. On a Macintosh classic, it appears in a window that's created with the first error message. With Mac OS X, it may appear in a new window, or you may have to launch the "Console" application to see it. On Windows, you may have to run one the "Debug" batch files to see the error messages; look for them in the application's directory.

Error logging is controlled by the "default.lcf" file. It has lots of comments on what the various terms mean. If you'd like messages to be logged to a file, change the line

log4j.rootCategory= WARN, A1

to include the additional logging destination "R":

log4j.rootCategory= WARN, A1,R

R is defined later in default.lcf as logging to the "example.log" file. You can also get a lot of additional information on what the program is doing by setting the log level to either INFO or DEBUG, e.g.

log4j.rootCategory= INFO, A1

Note that the DEBUG level will output a lot of information, and will slow down operation significantly. Its also possible to request more information on just parts of the program, but in order for that to be useful you have to have spent some time learning about the internals.

Debugging problems with XML files

When an XML file can't be parsed, you'll get some hard-to-understand error messages. The most important part of this is the line number. Use that to start looking for the problem.

You might be able to get better debugging information by trying to open the file with Internet Explorer. The debugging information it provides is generally more detailed than that provided by the XML routines in the JDOM libraries used by JMRI and Decoder Pro.

Note that Explorer needs to see both the .xml file, plus the definition information in the .dtd file. If you get a message like "error in system resource", you need to put a copy of the associated .dtd file (e.g. decoder-config.dtd) in the directory with your new file. DTD's can be found in the dtd subdirectory of the xml directory.