Allow debug & assert messages to be redirected, and log test output