]> git.pond.sub.org Git - empserver/commitdiff
Use the thread name to identify threads in the journal
authorRon Koenderink <rkoenderink@yahoo.ca>
Thu, 11 Sep 2008 20:49:28 +0000 (14:49 -0600)
committerRon Koenderink <rkoenderink@yahoo.ca>
Thu, 11 Sep 2008 20:49:28 +0000 (14:49 -0600)
This makes the journal easier to read, and makes journals
from the nightly build easier to diff.

Since we use only the 10 first characters of the name,
abridge existing thread names to make them unique within
that many characters.

src/lib/player/accept.c
src/lib/subs/journal.c

index d5ecbcb99febda851557c21bae6a4a62f1ce2ee2..a2dce0ed339f14bf43e87d502830dab5d2fb5455 100644 (file)
@@ -213,7 +213,7 @@ player_accept(void *unused)
        stacksize = 100000
 /* budget */  + MAX(WORLD_SZ() * sizeof(int) * 7,
 /* power */ MAXNOC * sizeof(struct powstr));
-       sprintf(buf, "Player (fd #%d)", ns);
+       sprintf(buf, "Conn%d", ns);
        empth_create(player_login, stacksize, 0, buf, np);
     }
 }
index 0c95115e7fe5e394cc8b0d6ebdaae4485b6c5712..fcaa752c58f7e1b225433d61e8da19f782af5081 100644 (file)
@@ -83,7 +83,7 @@ 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());
        
        va_start(ap, fmt);
        vsnprintf(buf, sizeof(buf) - 1, fmt, ap);