Implement diagnostic logging when built in debug mode. Pass --debug-log=log.txt as an argument when starting turbobird to save the output