From 091f7d56b288b83a32a2f7286ce532e5471ed49b Mon Sep 17 00:00:00 2001
From: mihaf <miha.fosnaric@gmail.com>
Date: Fri, 11 Apr 2014 08:10:45 +0000
Subject: [PATCH] Merge branch 'trout-rbc' of https://bitbucket.org/samop/trisurf-ng into trout-rbc

---
 src/general.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/general.c b/src/general.c
index ed06398..a600800 100644
--- a/src/general.c
+++ b/src/general.c
@@ -3,10 +3,20 @@
 #include "general.h"
 #include<stdarg.h>
 
+#include <sys/time.h>
+#include <unistd.h>
+#include <time.h>
+
+
 ts_uint ts_fprintf(FILE *fd, char *fmt, ...){
 if(quiet) return TS_SUCCESS;
-    va_list ap;
-    va_start(ap,fmt);
+	va_list ap;
+	va_start(ap,fmt);
+	char tmbuf[255];
+	struct timeval now;
+  	gettimeofday(&now, 0);
+	strftime(tmbuf, sizeof tmbuf, "%Y-%m-%d %H:%M:%S", localtime(&now.tv_sec));
+fprintf(fd, "[%s] ",tmbuf); 
 vfprintf(fd, fmt, ap); /* Call vfprintf */
 va_end(ap); /* Cleanup the va_list */
 return TS_SUCCESS;

--
Gitblit v1.9.3