1 see http://bugs.mutt.org/3263, this patch adds time/date to
2 the entries in .muttdebug so it will be easier to correlate them
3 to external events logged in tcpdump streams or logfiles
10 setbuf (debugfile, NULL); /* don't buffer the debugging output! */
11 - fprintf (debugfile, "Mutt %s started at %s.\nDebugging at level %d.\n\n",
12 - MUTT_VERSION, asctime (localtime (&t)), debuglevel);
13 + dprint(1,(debugfile,"Mutt/%s (%s) debugging at level %d\n",
14 + MUTT_VERSION, ReleaseDate, debuglevel));
20 @@ -1007,6 +1007,24 @@
21 return sysexits_h[i].str;
24 +void mutt_debug (FILE *fp, const char *fmt, ...)
27 + time_t now = time (NULL);
28 + static char buf[23] = "";
29 + static time_t last = 0;
33 + strftime (buf, sizeof (buf), "%Y-%m-%d %H:%M:%S", localtime (&now));
36 + fprintf (fp, "[%s] ", buf);
38 + vfprintf (fp, fmt, ap);
42 int mutt_atos (const char *str, short *dst)
48 MUTT_LIB_WHERE FILE *debugfile MUTT_LIB_INITVAL(0);
49 MUTT_LIB_WHERE int debuglevel MUTT_LIB_INITVAL(0);
51 -# define dprint(N,X) do { if(debuglevel>=N && debugfile) fprintf X; } while (0)
52 +void mutt_debug (FILE *, const char *, ...);
54 +# define dprint(N,X) do { if(debuglevel>=N && debugfile) mutt_debug X; } while (0)