Core: Add toggleable debug logging

* Also fix a missing space in debug log messages introduced
  with the previous timestamp logging update
6 files changed