]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
conftest: Fix log level settings for stdout
authorThomas Klute <thomas2.klute@uni-dortmund.de>
Thu, 3 Jan 2013 15:03:44 +0000 (16:03 +0100)
committerMartin Willi <martin@revosec.ch>
Tue, 8 Jan 2013 10:12:10 +0000 (11:12 +0100)
This patch fixes bug #272 ("conftest ignores log settings for stdout").
http://wiki.strongswan.org/issues/272

According to the documentation of add_logger in src/libcharon/bus/bus.h,
the relevant log levels of a logger are registered with the logging
subsystem when adding the logger. If the log levels change later, the
logger must be re-added to propagate the new settings. In conftest.c,
the stdout logger is initialized and added before reading the logging
settings, but wasn't re-added after reading the settings.

src/conftest/conftest.c

index bb4c5ed97120f1eeabfae3f9cd9924378732e5a0..e8c257d5e01c207f7a00b142817447b24be41728 100644 (file)
@@ -386,6 +386,9 @@ static void load_loggers(file_logger_t *logger)
        char *section;
 
        load_log_levels(logger, "stdout");
+       /* Re-add the logger to propagate configuration changes to the
+        * logging system */
+       charon->bus->add_logger(charon->bus, &logger->logger);
 
        enumerator = conftest->test->create_section_enumerator(conftest->test, "log");
        while (enumerator->enumerate(enumerator, &section))