Real logging and removal of old debug routine.