mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 08:36:30 +00:00
Simplify logger_init() parameters
We're passing the t_configuration_options structure anyway, no need to pass items it contains as separate parameters.
This commit is contained in:
5
log.c
5
log.c
@@ -141,8 +141,11 @@ log_verbose(int level, const char *fmt, ...)
|
|||||||
|
|
||||||
|
|
||||||
bool
|
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 l;
|
||||||
int f;
|
int f;
|
||||||
|
|
||||||
|
|||||||
3
log.h
3
log.h
@@ -116,8 +116,7 @@ int detect_log_level(const char *level);
|
|||||||
|
|
||||||
/* Logger initialisation and shutdown */
|
/* Logger initialisation and shutdown */
|
||||||
|
|
||||||
bool logger_init(t_configuration_options * opts, const char *ident,
|
bool logger_init(t_configuration_options * opts, const char *ident);
|
||||||
const char *level, const char *facility);
|
|
||||||
|
|
||||||
bool logger_shutdown(void);
|
bool logger_shutdown(void);
|
||||||
|
|
||||||
|
|||||||
2
repmgr.c
2
repmgr.c
@@ -536,7 +536,7 @@ main(int argc, char **argv)
|
|||||||
strncpy(options.loglevel, runtime_options.loglevel, MAXLEN);
|
strncpy(options.loglevel, runtime_options.loglevel, MAXLEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger_init(&options, progname(), options.loglevel, options.logfacility);
|
logger_init(&options, progname());
|
||||||
|
|
||||||
if (runtime_options.verbose)
|
if (runtime_options.verbose)
|
||||||
logger_set_verbose();
|
logger_set_verbose();
|
||||||
|
|||||||
@@ -229,8 +229,7 @@ main(int argc, char **argv)
|
|||||||
strerror(errno));
|
strerror(errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
logger_init(&local_options, progname(), local_options.loglevel,
|
logger_init(&local_options, progname());
|
||||||
local_options.logfacility);
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
logger_set_verbose();
|
logger_set_verbose();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user