From 430524810e67d3c223a2ab819f45b882b419c45d Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 14 Jun 2005 12:29:40 +0000 Subject: Incorporated the use of the Info object everywhere... also using the log functionality. --- src/info.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/info.cc') diff --git a/src/info.cc b/src/info.cc index 4278326..56d1dfd 100644 --- a/src/info.cc +++ b/src/info.cc @@ -31,6 +31,9 @@ /* * $Log$ + * Revision 1.2 2005/06/14 12:29:40 deva + * Incorporated the use of the Info object everywhere... also using the log functionality. + * * Revision 1.1 2005/06/13 20:38:19 deva * Added some logfile code. * Enhanced the file object... now ready to hook into mov_encoder @@ -40,6 +43,8 @@ #include #include "info.h" +#include + Info::Info() { pthread_mutex_init (&mutex, NULL); } @@ -65,7 +70,12 @@ void Info::log(char *fmt, ...) va_end(argp); time_t t = time(NULL); - fprintf(fp, "%s miav[%d]", ctime(&t), buf, getpid()); + char sdate[32]; + memset(sdate, 0, sizeof(sdate)); + strftime(sdate, sizeof(sdate), "%d %b %H:%M:%S", localtime(&t)); + + fprintf(fp, "%s miav[%d] %s\n", sdate, getpid(), buf); + fprintf(stderr, "%s miav[%d] %s\n", sdate, getpid(), buf); fclose(fp); -- cgit v1.2.3