From effc1b187ace9f9c52800b482657415320f701e1 Mon Sep 17 00:00:00 2001 From: Ron Koenderink Date: Thu, 11 Sep 2008 14:49:28 -0600 Subject: [PATCH] Use the thread name to identify threads in the journal 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 | 2 +- src/lib/subs/journal.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/player/accept.c b/src/lib/player/accept.c index d5ecbcb99..a2dce0ed3 100644 --- a/src/lib/player/accept.c +++ b/src/lib/player/accept.c @@ -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); } } diff --git a/src/lib/subs/journal.c b/src/lib/subs/journal.c index 0c95115e7..fcaa752c5 100644 --- a/src/lib/subs/journal.c +++ b/src/lib/subs/journal.c @@ -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); -- 2.43.0