Added a timestamp to the logging output by trace_io.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
emellor@leeni.uk.xensource.com committed 2005-10-24 14:12:42 +01:00
1 parent 493b98bf23
commit 8b6e8053b8
1 file changed
+7 -1
+7 -1
View File
@@ -178,12 +178,18 @@ static void trace_io(const struct connection *conn,
{
char string[64];
unsigned int i;
time_t now;
struct tm *tm;
if (tracefd < 0)
return;
now = time(NULL);
tm = localtime(&now);
write(tracefd, prefix, strlen(prefix));
sprintf(string, " %p ", conn);
sprintf(string, " %p %0d:%0d:%0d ", conn, tm->tm_hour, tm->tm_min,
tm->tm_sec);
write(tracefd, string, strlen(string));
write(tracefd, sockmsg_string(data->hdr.msg.type),
strlen(sockmsg_string(data->hdr.msg.type)));
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.