$Log$
+ Revision 573.75 2001/01/28 09:50:02 error
+ * sysdep.c: lprintf() now generates timestamps
+
Revision 573.74 2001/01/28 07:35:04 error
* serv_bio.c: RBIO now also returns stats about a user, see session.txt
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
va_end(arg_ptr);
if (loglevel <= verbosity) {
- fprintf(stderr, "%s", buf);
+ struct timeval tv;
+ struct tm *tim;
+
+ gettimeofday(&tv, NULL);
+ tim = localtime(&(tv.tv_sec));
+ /*
+ * Log provides millisecond accuracy. If you need
+ * microsecond accuracy and your OS supports it, change
+ * %03ld to %06ld and remove " / 1000" after tv.tv_usec.
+ */
+ fprintf(stderr, "%04d/%02d/%02d %2d:%02d:%02d.%03ld %s",
+ tim->tm_year + 1900, tim->tm_mon + 1, tim->tm_mday,
+ tim->tm_hour, tim->tm_min, tim->tm_sec,
+ tv.tv_usec / 1000, buf);
fflush(stderr);
}