optimize
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1131 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
6469703905
commit
4959cbff2b
|
@ -55,6 +55,7 @@ static int8_t all_level = -1;
|
|||
static void del_mapping(char *var) {
|
||||
if (!strcasecmp(var, "all")) {
|
||||
all_level = -1;
|
||||
return;
|
||||
}
|
||||
switch_core_hash_insert(log_hash, var, NULL);
|
||||
}
|
||||
|
@ -63,6 +64,11 @@ static void add_mapping(char *var, char *val)
|
|||
{
|
||||
char *name;
|
||||
|
||||
if (!strcasecmp(var, "all")) {
|
||||
all_level = (int8_t) switch_log_str2level(val);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(name = switch_core_hash_find(name_hash, var))) {
|
||||
name = switch_core_strdup(module_pool, var);
|
||||
switch_core_hash_insert(name_hash, name, name);
|
||||
|
@ -109,15 +115,6 @@ static switch_status switch_console_logger(const switch_log_node *node, switch_l
|
|||
|
||||
if (!lookup) {
|
||||
lookup = switch_core_hash_find(log_hash, node->func);
|
||||
|
||||
if (!lookup && all_level == -1) {
|
||||
if ((lookup = switch_core_hash_find(log_hash, "all"))) {
|
||||
all_level = *lookup;
|
||||
} else {
|
||||
all_level = -2;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue