Index: dprint.h =================================================================== --- dprint.h (revision 5321) +++ dprint.h (working copy) @@ -59,6 +59,8 @@ #endif #include +#include +#include #define L_ALERT -3 /*!< Alert level */ #define L_CRIT -2 /*!< Critical level */ @@ -162,13 +164,16 @@ */ inline static char* dp_time(void) { - time_t ltime; + struct timeval tp ; + struct tm res ; - time(<ime); - ctime_r( <ime, ctime_buf); - ctime_buf[19] = 0; /* remove year*/ + gettimeofday(&tp, NULL ); + localtime_r(&tp.tv_sec, &res) ; + /* Make sure ctime_buf is big enough ! */ + strftime(ctime_buf, 32, "%m/%d/%Y %H:%M:%S", &res) ; + sprintf(ctime_buf + 18, ".%06ld", tp.tv_usec) ; - return ctime_buf+4; /* remove name of day*/ + return ctime_buf ; } @@ -336,15 +341,15 @@ #else /*SUN_PRO_C*/ - #define LOG_PREFIX MOD_NAME ":%s: " + #define LOG_PREFIX MOD_NAME ":%s:%d:%s: " #define MY_DPRINT( _prefix, _fmt, args...) \ dprint( _prefix LOG_PREFIX _fmt, dp_time(), \ - dp_my_pid(), __DP_FUNC, ## args) \ + dp_my_pid(), __FILE__, __LINE__, __DP_FUNC, ## args) \ #define MY_SYSLOG( _log_level, _prefix, _fmt, args...) \ syslog( (_log_level)|log_facility, \ - _prefix LOG_PREFIX _fmt, __DP_FUNC, ##args);\ + _prefix LOG_PREFIX _fmt, __FILE__, __LINE__, __DP_FUNC, ##args);\ #define LM_GEN1(_lev, args...) \ LM_GEN2( log_facility, _lev, ##args)