Log Files

For me one of the most important features of the software is the logging.  As it's running, it's spitting out thousands of lines of log files in an organised fashion to allow me to work out what it's up to.  My belief is that without these log files i'd never have got it as far as I have, or not this quickly anyway.

Here's an example of what i mean....

A train overruns it's stopping point and shorts the track out by running the wrong way across some points.  I have to work out why.

I start reading log files.  I can tell what each train is doing, when it makes it's speed decisions, why it made them, which sensors fired, etc.

The log files also log lots of other important stuff, such as:

  • The speed traps.  This lets me tell how well calibrated the trains are.  If the software thinks they should be travelling at 37 cm/sec but actually they're doing 60 cm/sec, then it's all going to end in tears.  Here's an example of a speed trap log file:

    Note there's a bit of nonsense in there, for example the second instance of 47 class near the bottom.  This is usually caused by the magnets in the rear of the train getting it all in a bit of a tangle. 
  • Unexpected Sensors.  This tracks when sensors fire in unlocked track sections, this helps me find any wiring faults.  Before I used shielded cable this happened quite a lot, not an issue any more.
  • Speed Limits.  This helps me to see how it's calculating the best running speed for any given section of track.  It's a complex calculation due to distance, stopping distance, and the limit applied.
  • Route Calculations.  This helps me work out why a train decided to go a certain route, and shows the logic and distance calculations
  • etc,etc. Lots and lots of stuff logged!

Comments