diff --git a/common/include/common/debug.h b/common/include/common/debug.h index 4b205393..2b516ac0 100644 --- a/common/include/common/debug.h +++ b/common/include/common/debug.h @@ -18,6 +18,8 @@ Place, Suite 330, Boston, MA 02111-1307 USA */ #include +#include +#include "time.h" #if defined(_WIN32) && !defined(__GNUC__) #define DIRECTORY_SEPARATOR '\\' @@ -47,7 +49,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA sizeof(s) > 20 && (s)[sizeof(s)-21] == DIRECTORY_SEPARATOR ? (s) + sizeof(s) - 20 : \ sizeof(s) > 21 && (s)[sizeof(s)-22] == DIRECTORY_SEPARATOR ? (s) + sizeof(s) - 21 : (s)) -#define DEBUG_PRINT(type, fmt, ...) do {fprintf(stderr, type " %20s:%-4u | %-30s | " fmt "\n", STRIPPATH(__FILE__), __LINE__, __FUNCTION__, ##__VA_ARGS__);} while (0) +#define DEBUG_PRINT(type, fmt, ...) do {fprintf(stderr, "%" PRId64 " " type " %20s:%-4u | %-30s | " fmt "\n", microtime(), STRIPPATH(__FILE__), __LINE__, __FUNCTION__, ##__VA_ARGS__);} while (0) #define DEBUG_INFO(fmt, ...) DEBUG_PRINT("[I]", fmt, ##__VA_ARGS__) #define DEBUG_WARN(fmt, ...) DEBUG_PRINT("[W]", fmt, ##__VA_ARGS__) @@ -58,4 +60,4 @@ Place, Suite 330, Boston, MA 02111-1307 USA #define DEBUG_PROTO(fmt, args...) DEBUG_PRINT("[P]", fmt, ##args) #else #define DEBUG_PROTO(fmt, ...) do {} while(0) -#endif \ No newline at end of file +#endif