From b010bb1f079d4e3c3099d6246e21ca8495203955 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Wed, 5 Dec 2007 13:25:33 +0000 Subject: [PATCH] always init the levels array. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6518 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/loggers/mod_logfile/mod_logfile.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/mod/loggers/mod_logfile/mod_logfile.c b/src/mod/loggers/mod_logfile/mod_logfile.c index 924ac20d65..aafe5eca47 100644 --- a/src/mod/loggers/mod_logfile/mod_logfile.c +++ b/src/mod/loggers/mod_logfile/mod_logfile.c @@ -94,15 +94,6 @@ void process_levels(logfile_profile_t *profile, char *p) int x, i, argc = 0; char *argv[10] = { 0 }; - profile->levels[0].level = SWITCH_LOG_CONSOLE; - profile->levels[1].level = SWITCH_LOG_ALERT; - profile->levels[2].level = SWITCH_LOG_CRIT; - profile->levels[3].level = SWITCH_LOG_ERROR; - profile->levels[4].level = SWITCH_LOG_WARNING; - profile->levels[5].level = SWITCH_LOG_NOTICE; - profile->levels[6].level = SWITCH_LOG_INFO; - profile->levels[7].level = SWITCH_LOG_DEBUG; - for (i=0; i < (sizeof(profile->levels) / sizeof(struct level_set)); i++) { profile->levels[i].on = 0; } @@ -269,6 +260,15 @@ static switch_status_t load_profile(logfile_profile_t *profile, switch_xml_t xml { switch_xml_t param; + profile->levels[0].level = SWITCH_LOG_CONSOLE; + profile->levels[1].level = SWITCH_LOG_ALERT; + profile->levels[2].level = SWITCH_LOG_CRIT; + profile->levels[3].level = SWITCH_LOG_ERROR; + profile->levels[4].level = SWITCH_LOG_WARNING; + profile->levels[5].level = SWITCH_LOG_NOTICE; + profile->levels[6].level = SWITCH_LOG_INFO; + profile->levels[7].level = SWITCH_LOG_DEBUG; + for (param = switch_xml_child(xml, "param"); param; param = param->next) { char *var = (char *) switch_xml_attr_soft(param, "name"); char *val = (char *) switch_xml_attr_soft(param, "value");