From: Jean-Philippe Orsini Date: Mon, 20 Aug 2012 10:02:22 +0000 (+0000) Subject: added log_info fct X-Git-Tag: v0.8.0.5~259 X-Git-Url: https://git.wpitchoune.net/gitweb/?p=psensor.git;a=commitdiff_plain;h=175dc27d747677df108f802b5ccdde6e9df784bd added log_info fct --- diff --git a/src/lib/log.c b/src/lib/log.c index 7a9fc42..2b7f08a 100644 --- a/src/lib/log.c +++ b/src/lib/log.c @@ -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); +} diff --git a/src/lib/log.h b/src/lib/log.h index 3aa4175..9a20c12 100644 --- a/src/lib/log.h +++ b/src/lib/log.h @@ -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(); diff --git a/src/server/server.c b/src/server/server.c index cb0dc77..505d511 100644 --- a/src/server/server.c +++ b/src/server/server.c @@ -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);