]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/journal.c
Update copyright notice
[empserver] / src / lib / subs / journal.c
index 7758859eaa6faeeabab6ae950daad45dbebe2d0f..cd187132a122e9043edc58b56b9e0d6b553d6f40 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
  *  ---
  *
  *  journal.c: Log a journal of events to a file
- * 
+ *
  *  Known contributors to this file:
  *     Markus Armbruster, 2004-2008
+ *     Ron Koenderink, 2008
  */
 
 /*
@@ -64,6 +65,9 @@
 static char journal_fname[] = "journal.log";
 static FILE *journal;
 
+static void journal_entry(char *fmt, ...)
+    ATTRIBUTE((format (printf, 1, 2)));
+
 static FILE *
 journal_open(void)
 {
@@ -80,8 +84,9 @@ journal_entry(char *fmt, ...)
 
     if (journal) {
        time(&now);
-       fprintf(journal, "%.24s %p ", ctime(&now), empth_self());
-       
+       fprintf(journal, "%.24s %10.10s ",
+               ctime(&now), empth_name(empth_self()));
+
        va_start(ap, fmt);
        vsnprintf(buf, sizeof(buf) - 1, fmt, ap);
        va_end(ap);
@@ -93,8 +98,7 @@ journal_entry(char *fmt, ...)
                fprintf(journal, "\\%03o", *p);
        }
        fputs("\n", journal);
-       if (debug)
-           fflush(journal);
+       fflush(journal);
        if (ferror(journal)) {
            logerror("Error writing journal (%s)", strerror(errno));
            clearerr(journal);