+
+//
+// This logger is used mainly to ensure that text gets written to the log file
+// even if the program crashes. The performance hit is acceptable in this case!
+//
+
+void WriteLog(const char * text, ...)
+{
+ va_list arg;
+
+ va_start(arg, text);
+ vfprintf(log_stream, text, arg);
+ va_end(arg);
+ fflush(log_stream); // Make sure that text is written!
+}