Added support for logging per-state output.