diff options
author | Thomas Klute <thomas2.klute@uni-dortmund.de> | 2013-01-04 13:47:15 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2013-01-08 11:12:44 +0100 |
commit | 13c177852fd8fea5bd94e3cba3119443c8497f2e (patch) | |
tree | 085ee196e034e8e2bd489bda14e465465bd842a0 /src/conftest/conftest.c | |
parent | b78698f75586bf950dd955b1dbfcfe3874927a14 (diff) | |
download | strongswan-13c177852fd8fea5bd94e3cba3119443c8497f2e.tar.bz2 strongswan-13c177852fd8fea5bd94e3cba3119443c8497f2e.tar.xz |
conftest: Add support for time_format and ike_name options in log sections
Both options are well supported for normal operation but were completely
ignored by conftest, which used hard coded defaults. File options are
still missing but could be added in a similar way.
Diffstat (limited to 'src/conftest/conftest.c')
-rw-r--r-- | src/conftest/conftest.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/conftest/conftest.c b/src/conftest/conftest.c index e8c257d5e..c2251effa 100644 --- a/src/conftest/conftest.c +++ b/src/conftest/conftest.c @@ -378,6 +378,22 @@ static void load_log_levels(file_logger_t *logger, char *section) } /** + * Load logger options for a logger from section + */ +static void load_logger_options(file_logger_t *logger, char *section) +{ + bool ike_name; + char *time_format; + + time_format = conftest->test->get_str(conftest->test, + "log.%s.time_format", NULL, section); + ike_name = conftest->test->get_bool(conftest->test, + "log.%s.ike_name", FALSE, section); + + logger->set_options(logger, time_format, ike_name); +} + +/** * Load logger configuration */ static void load_loggers(file_logger_t *logger) @@ -386,6 +402,7 @@ static void load_loggers(file_logger_t *logger) char *section; load_log_levels(logger, "stdout"); + load_logger_options(logger, "stdout"); /* Re-add the logger to propagate configuration changes to the * logging system */ charon->bus->add_logger(charon->bus, &logger->logger); @@ -396,7 +413,7 @@ static void load_loggers(file_logger_t *logger) if (!streq(section, "stdout")) { logger = file_logger_create(section); - logger->set_options(logger, NULL, FALSE); + load_logger_options(logger, section); logger->open(logger, FALSE, FALSE); load_log_levels(logger, section); charon->bus->add_logger(charon->bus, &logger->logger); |