[Phonehome-commits] r126 - trunk/client/src

pamadio at garage.maemo.org pamadio at garage.maemo.org
Mon Oct 27 21:02:38 EET 2008


Author: pamadio
Date: 2008-10-27 21:02:38 +0200 (Mon, 27 Oct 2008)
New Revision: 126

Modified:
   trunk/client/src/dsk_mgr.c
Log:
cosmetic debug

Modified: trunk/client/src/dsk_mgr.c
===================================================================
--- trunk/client/src/dsk_mgr.c	2008-10-26 18:57:45 UTC (rev 125)
+++ trunk/client/src/dsk_mgr.c	2008-10-27 19:02:38 UTC (rev 126)
@@ -92,16 +92,28 @@
 
 void log_debug(gchar *snt){
   FILE *fh;
-  g_print("debug: %s",snt);
+  char now_snt[256];
+  const time_t now=time(NULL);
+  struct tm *now_tm=localtime(&now);
+
+  strftime(now_snt,sizeof(now_snt),"%F %T",now_tm);
+
+
+  g_print("[%s] %s",now_snt,snt);
+
   if(log_debug_flag!=TRUE) {
     return;
   }
+
+  
+  
+
   fh=fopen(TMP_DEBUG_FILE,"a");
   if(fh==NULL){
     g_print( "Problem appending to  %s: %s\n", TMP_DEBUG_FILE,strerror( errno ));
     return;
   }
-  fprintf(fh,"%s",snt);
+  fprintf(fh,"[%s] %s",now_snt,snt);
   fclose(fh);
 }
 



More information about the Phonehome-commits mailing list