implemented a debug_log in /tmp, debug mode defaults to off