Add code to log to a temporary file (gLogFile) as well as to the console. This file will be displayed by error diagnostic dialog.