summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lasso/xml/debug.c12
-rw-r--r--lasso/xml/debug.h3
2 files changed, 11 insertions, 4 deletions
diff --git a/lasso/xml/debug.c b/lasso/xml/debug.c
index 5dd4908c..90c33020 100644
--- a/lasso/xml/debug.c
+++ b/lasso/xml/debug.c
@@ -22,6 +22,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <stdio.h>
+#include <stdarg.h>
+#include <time.h>
+
#include <lasso/xml/debug.h>
#define normal "\033[m"
@@ -56,6 +60,8 @@ _debug(unsigned int level,
{
char debug_string[1024];
char new_debug_string[2048];
+ time_t ts;
+ char date[20];
char *color;
va_list args;
@@ -69,6 +75,9 @@ _debug(unsigned int level,
vsnprintf(debug_string, sizeof(debug_string), format, args);
va_end(args);
+ time(&ts);
+ strftime(date, 20, "%d-%m-%Y %H:%M:%S", localtime(&ts));
+
switch (level) {
case ERROR:
color = red;
@@ -85,10 +94,11 @@ _debug(unsigned int level,
}
sprintf(new_debug_string,
- "%s%s%s (%s/%s:%d)\t%s",
+ "%s%s%s %s (%s/%s:%d)\t%s",
color,
errorcode[level],
normal,
+ date,
debug_filename, debug_function,
debug_line, debug_string);
diff --git a/lasso/xml/debug.h b/lasso/xml/debug.h
index b497efc9..19a0e277 100644
--- a/lasso/xml/debug.h
+++ b/lasso/xml/debug.h
@@ -25,9 +25,6 @@
#ifndef __LASSO_DEBUG_H__
#define __LASSO_DEBUG_H__
-#include <stdio.h>
-#include <stdarg.h>
-
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */