added log_info fct
authorJean-Philippe Orsini <jeanfi@gmail.com>
Mon, 20 Aug 2012 10:02:22 +0000 (10:02 +0000)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Mon, 20 Aug 2012 10:02:22 +0000 (10:02 +0000)
src/lib/log.c
src/lib/log.h
src/server/server.c

index 7a9fc42..2b7f08a 100644 (file)
@@ -135,3 +135,12 @@ void log_warn(const char *fmt, ...)
        vlogf(LOG_WARN, fmt, ap);
        va_end(ap);
 }
+
+void log_info(const char *fmt, ...)
+{
+       va_list ap;
+
+       va_start(ap, fmt);
+       vlogf(LOG_INFO, fmt, ap);
+       va_end(ap);
+}
index 3aa4175..9a20c12 100644 (file)
@@ -31,6 +31,7 @@ void log_open(const char *path);
 void log_printf(int lvl, const char *fmt, ...);
 void log_debug(const char *fmt, ...);
 void log_err(const char *fmt, ...);
+void log_info(const char *fmt, ...);
 void log_warn(const char *fmt, ...);
 
 void log_close();
index cb0dc77..505d511 100644 (file)
@@ -347,9 +347,7 @@ int main(int argc, char *argv[])
                        exit(EXIT_SUCCESS);
                case 'd':
                        log_level = atoi(optarg);
-                       log_printf(LOG_INFO,
-                                  _("Enables debug mode: %d"),
-                                  log_level);
+                       log_info(_("Enables debug mode: %d"), log_level);
                        break;
                case 'l':
                        if (optarg)
@@ -395,9 +393,9 @@ int main(int argc, char *argv[])
                exit(EXIT_FAILURE);
        }
 
-       log_printf(LOG_INFO, _("Web server started on port: %d"), port);
-       log_printf(LOG_INFO, _("WWW directory: %s"), server_data.www_dir);
-       log_printf(LOG_INFO, _("URL: http://localhost:%d"), port);
+       log_info(_("Web server started on port: %d"), port);
+       log_info(_("WWW directory: %s"), server_data.www_dir);
+       log_info(_("URL: http://localhost:%d"), port);
 
        while (!server_stop_requested) {
                pthread_mutex_lock(&mutex);