print the date and time in the log output..
---- IRC log started Tue Sep 21 22:27 [Sep 21 22:27] *** Value of LOG set to ON [Sep 21 22:27] > hello [Sep 21 22:27] -> *drahn* hello [Sep 21 22:28] *drahn* helloback IRC log ended Tue Sep 21 22:28 ---- From drahn@
This commit is contained in:
parent
509d5fec37
commit
96936acd99
21
net/ircII/patches/patch-source_log_c
Normal file
21
net/ircII/patches/patch-source_log_c
Normal file
@ -0,0 +1,21 @@
|
||||
$OpenBSD: patch-source_log_c,v 1.1 2004/11/02 03:26:26 brad Exp $
|
||||
--- source/log.c.orig Tue Jan 6 00:42:16 2004
|
||||
+++ source/log.c Tue Sep 21 22:26:52 2004
|
||||
@@ -172,9 +172,16 @@ add_to_log(fp, line)
|
||||
FILE *fp;
|
||||
u_char *line;
|
||||
{
|
||||
+ time_t t;
|
||||
+ struct tm *tm;
|
||||
+ char buf[32];
|
||||
+
|
||||
if (fp)
|
||||
{
|
||||
- fprintf(fp, "%s\n", line);
|
||||
+ t = time(0);
|
||||
+ tm = localtime(&t);
|
||||
+ strftime(buf, sizeof buf, "%b %d %R", tm);
|
||||
+ fprintf(fp, "[%s] %s\n", buf, line);
|
||||
fflush(fp);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user