WIP: adding debug logging with timing instrumentation.