From 1b5a08cbaa6e91ed68be8f991cbb0d8b187f5337 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 5 Sep 2014 12:14:21 +0200 Subject: [PATCH] Dump configuration file during start PAZ-957 --- src/pazpar2.c | 19 +++++++++++-------- src/pazpar2_config.c | 13 +++++-------- src/pazpar2_config.h | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/pazpar2.c b/src/pazpar2.c index 24526d0..51b7249 100644 --- a/src/pazpar2.c +++ b/src/pazpar2.c @@ -208,7 +208,17 @@ static int sc_main( } pazpar2_mutex_init(); - config = config_create(config_fname, global_parameters.dump_records); + if (!test_mode) + { + yaz_log(YLOG_LOG, "Pazpar2 start " VERSION " " +#ifdef PAZPAR2_VERSION_SHA1 + PAZPAR2_VERSION_SHA1 +#else + "-" +#endif + ); + } + config = config_create(config_fname); if (!config) return 1; sc_stop_config = config; @@ -219,13 +229,6 @@ static int sc_main( } else { - yaz_log(YLOG_LOG, "Pazpar2 start " VERSION " " -#ifdef PAZPAR2_VERSION_SHA1 - PAZPAR2_VERSION_SHA1 -#else - "-" -#endif - ); ret = 0; if (daemon && !log_file_in_use) { diff --git a/src/pazpar2_config.c b/src/pazpar2_config.c index 785293e..dbfd850 100644 --- a/src/pazpar2_config.c +++ b/src/pazpar2_config.c @@ -1276,7 +1276,7 @@ static int parse_config(struct conf_config *config, xmlNode *root) return 0; } -struct conf_config *config_create(const char *fname, int verbose) +struct conf_config *config_create(const char *fname) { xmlDoc *doc = xmlReadFile(fname, NULL, @@ -1330,16 +1330,13 @@ struct conf_config *config_create(const char *fname, int verbose) r = yaz_xml_include_simple(n, wrbuf_cstr(config->confdir)); if (r == 0) /* OK */ { - if (verbose) - { - yaz_log(YLOG_LOG, "Configuration %s after include processing", - fname); + yaz_log(YLOG_LOG, "Configuration %s after include processing", + fname); #if LIBXML_VERSION >= 20600 - xmlDocFormatDump(yaz_log_file(), doc, 0); + xmlDocFormatDump(yaz_log_file(), doc, 0); #else - xmlDocDump(yaz_log_file(), doc); + xmlDocDump(yaz_log_file(), doc); #endif - } r = parse_config(config, n); } xmlFreeDoc(doc); diff --git a/src/pazpar2_config.h b/src/pazpar2_config.h index 3c03cb3..1343790 100644 --- a/src/pazpar2_config.h +++ b/src/pazpar2_config.h @@ -157,7 +157,7 @@ struct conf_server database_hosts_t database_hosts; }; -struct conf_config *config_create(const char *fname, int verbose); +struct conf_config *config_create(const char *fname); void config_destroy(struct conf_config *config); void config_process_events(struct conf_config *config); void info_services(struct conf_server *server, WRBUF w); -- 1.7.10.4