Here are a few quick notes on getting logging output from the simulator.
LOG
.-l NUM
switch, where NUM
can range from 0 to 8. -l 0
on the command line produces the least output, -l 8
produces the most.LOG.Debug("Hi there");
prints 'Hi there' to the console and the logging buffer (whose display is toggled by 'l' in the GUI) – if the logging level is 4 or larger.
LOG
offers simple, internally-implemented 'printf-like' functionality. Among other things, it supports '%d', '%o', '%x', '%s'. Its biggest current limitation is no floating point support (so, no '%f', '%e', or '%g' conversions). For example: virtual void Behavior(EventWindow<CC>& window) const { T self = window.GetCenterAtom(); LOG.Message("At (%d,%d): type is %04x (%s)", window.GetCenterInTile().GetX(), window.GetCenterInTile().GetY(), self.GetType(), "so there"); }
might print something like 20140928032150-3123: At (14,3): type is 00F0 (so there)
if the logging level was 3 or higher.