diff options
author | deva <deva> | 2005-06-14 12:29:40 +0000 |
---|---|---|
committer | deva <deva> | 2005-06-14 12:29:40 +0000 |
commit | 430524810e67d3c223a2ab819f45b882b419c45d (patch) | |
tree | 0abb4b2dd3dabc414c755c30e52d0b5022ee8670 /src/info.cc | |
parent | 0836a6e06f86e366017da3b2b2c132b3a4f2c877 (diff) |
Incorporated the use of the Info object everywhere... also using the log functionality.
Diffstat (limited to 'src/info.cc')
-rw-r--r-- | src/info.cc | 12 |
1 files changed, 11 insertions, 1 deletions
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 <config.h> #include "info.h" +#include <time.h> + 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); |