openbsd-ports/net/ircII/patches/patch-source_log_c

25 lines
531 B
Plaintext

$OpenBSD: patch-source_log_c,v 1.4 2014/09/20 18:40:27 naddy Exp $
--- source/log.c.orig Mon Mar 17 21:38:51 2014
+++ source/log.c Sat Sep 20 00:58:28 2014
@@ -157,12 +157,19 @@ set_log_file(u_char *filename)
void
add_to_log(FILE *fp, u_char *line)
{
+ time_t t;
+ struct tm *tm;
+ char buf[32];
+
if (fp == NULL)
fp = irclog_fp;
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);
}
}