fixed logging
authorJean-Philippe Orsini <jeanfi@gmail.com>
Sat, 12 Nov 2011 13:54:40 +0000 (13:54 +0000)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Sat, 12 Nov 2011 13:54:40 +0000 (13:54 +0000)
src/lib/log.c
src/lib/log.h
src/ui_notify.c

index 6018b54..2de7037 100644 (file)
@@ -101,12 +101,3 @@ void log_printf(int lvl, const char *fmt, ...)
                fprintf(stdf, "[%ld] %s %s\n", tv.tv_sec, lvl_str, buffer);
        }
 }
-
-void log_debug(const char *fmt, ...)
-{
-       va_list ap;
-
-       va_start(ap, fmt);
-       log_printf(LOG_ERR, fmt, ap);
-       va_end(ap);
-}
index 38efb3e..cf4fcd3 100644 (file)
@@ -30,7 +30,6 @@ enum log_level {
 void log_open(const char *path);
 
 void log_printf(int lvl, const char *fmt, ...);
-void log_debug(const char *fmt, ...);
 
 void log_close();
 
index 9422e63..cf0da1a 100644 (file)
@@ -39,8 +39,9 @@ void ui_notify(struct psensor *sensor, struct ui_psensor *ui)
        char *name;
        NotifyNotification *notif;
 
-       log_debug("ui_notify() last_notification %d",
-                 last_notification_tv.tv_sec);
+       log_printf(LOG_DEBUG,
+                  "ui_notify() last_notification %d",
+                  last_notification_tv.tv_sec);
 
        if (gettimeofday(&t, NULL) != 0) {
                log_printf(LOG_ERR,  _("gettimeofday failed"));
@@ -72,8 +73,9 @@ void ui_notify(struct psensor *sensor, struct ui_psensor *ui)
                                                NULL,
                                                GTK_WIDGET(ui->main_window));
 #endif
-               log_debug("ui_notify() notif_notification_new %s",
-                         sensor->name);
+               log_printf(LOG_DEBUG,
+                          "ui_notify() notif_notification_new %s",
+                          sensor->name);
 
                notify_notification_show(notif, NULL);