Rework file logging so that we don't do an fopen() and fclose() on every call to writeToLogFile() and writeToScriptLog().
This should speed up loading times on all platforms.
Authored by: plombo 2011-02-26
Parent: [r3071]
Child: [r3073]