]> Shamusworld >> Repos - thunder/blobdiff - src/log.cpp
Code cleanup.
[thunder] / src / log.cpp
index adf8a18a32cb137752e436e5205fbe0533c2a5f0..623a6b97e187a27c226890ad1d0734b050c0ff40 100644 (file)
@@ -1,61 +1,65 @@
 //
 // Log handler
 //
-// by James L. Hammons
-// (c) 2004, 2009 Underground Software
+// by James Hammons
+// (C) 2004, 2014 Underground Software
 //
-// JLH = James L. Hammons <jlhamm@acm.org>
+// JLH = James Hammons <jlhamm@acm.org>
 //
 // WHO  WHEN        WHAT
-// ---  ----------  ------------------------------------------------------------
+// ---  ----------  -----------------------------------------------------------
 // JLH  07/23/2009  Added changelog ;-)
 //
 
 #include "types.h"
 #include "log.h"
 
-#define MAX_LOG_SIZE           10000000                                // Maximum size of log file (10 MB)
+#define MAX_LOG_SIZE           10000000                // Maximum size of log file (10 MB)
 
-static FILE * log_stream = NULL;
+static FILE * logStream = NULL;
 static uint32 logSize = 0;
 
+
 bool InitLog(const char * path)
 {
-       log_stream = fopen(path, "wrt");
+       logStream = fopen(path, "wrt");
 
-       if (log_stream == NULL)
+       if (logStream == NULL)
                return false;
 
        return true;
 }
 
+
 void LogDone(void)
 {
-       if (log_stream)
-               fclose(log_stream);
+       if (logStream)
+               fclose(logStream);
 }
 
+
 //
 // 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, ...)
 {
-       if (!log_stream)
+       if (!logStream)
                return;
 
        va_list arg;
 
        va_start(arg, text);
-       logSize += vfprintf(log_stream, text, arg);
+       logSize += vfprintf(logStream, text, arg);
 
        if (logSize > MAX_LOG_SIZE)
        {
-               fflush(log_stream);
-               fclose(log_stream);
+               fflush(logStream);
+               fclose(logStream);
                exit(1);
-       }//*/
+       }
 
        va_end(arg);
-       fflush(log_stream);                                     // Make sure that text is written!
+       fflush(logStream);                                      // Make sure that text is written!
 }
+