From f64c42a5140471d0c71a13b1a2d5d76edcd7bae4 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Thu, 19 Nov 2015 14:03:14 +0900 Subject: [PATCH] Simplify logger_init() parameters We're passing the t_configuration_options structure anyway, no need to pass items it contains as separate parameters. --- log.c | 5 ++++- log.h | 3 +-- repmgr.c | 2 +- repmgrd.c | 3 +-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/log.c b/log.c index 8b2aa958..0dda2d0d 100644 --- a/log.c +++ b/log.c @@ -141,8 +141,11 @@ log_verbose(int level, const char *fmt, ...) bool -logger_init(t_configuration_options * opts, const char *ident, const char *level, const char *facility) +logger_init(t_configuration_options * opts, const char *ident) { + char *level = opts->loglevel; + char *facility = opts->logfacility; + int l; int f; diff --git a/log.h b/log.h index fa2d2e3b..b74f1db9 100644 --- a/log.h +++ b/log.h @@ -116,8 +116,7 @@ int detect_log_level(const char *level); /* Logger initialisation and shutdown */ -bool logger_init(t_configuration_options * opts, const char *ident, - const char *level, const char *facility); +bool logger_init(t_configuration_options * opts, const char *ident); bool logger_shutdown(void); diff --git a/repmgr.c b/repmgr.c index d7bc7b5c..b3c4ab63 100644 --- a/repmgr.c +++ b/repmgr.c @@ -536,7 +536,7 @@ main(int argc, char **argv) strncpy(options.loglevel, runtime_options.loglevel, MAXLEN); } - logger_init(&options, progname(), options.loglevel, options.logfacility); + logger_init(&options, progname()); if (runtime_options.verbose) logger_set_verbose(); diff --git a/repmgrd.c b/repmgrd.c index 4f17e010..6b72b838 100644 --- a/repmgrd.c +++ b/repmgrd.c @@ -229,8 +229,7 @@ main(int argc, char **argv) strerror(errno)); } - logger_init(&local_options, progname(), local_options.loglevel, - local_options.logfacility); + logger_init(&local_options, progname()); if (verbose) logger_set_verbose();