diff options
author | Walter Doekes <walter+asterisk@wjd.nu> | 2013-09-03 14:29:52 +0000 |
---|---|---|
committer | Walter Doekes <walter+asterisk@wjd.nu> | 2013-09-03 14:29:52 +0000 |
commit | 8b5d178c363bd8e04db9e110d3ca666533c5acf4 (patch) | |
tree | 041e9da8ece0abdc25f7f8475019d52826ab2788 | |
parent | 2d1d5a98d587f30311e254c7de623434dff07dd1 (diff) |
Be a little more verbose when loading cel_custom.conf.
Review: https://reviewboard.asterisk.org/r/2805/
........
Merged revisions 398167 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 398168 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 398196 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | cel/cel_custom.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cel/cel_custom.c b/cel/cel_custom.c index 0f72bd6ce..03b64aa74 100644 --- a/cel/cel_custom.c +++ b/cel/cel_custom.c @@ -82,6 +82,7 @@ static int load_config(void) struct ast_config *cfg; struct ast_variable *var; struct ast_flags config_flags = { 0 }; + int mappings = 0; int res = 0; cfg = ast_config_load(CONFIG, config_flags); @@ -90,7 +91,10 @@ static int load_config(void) return -1; } - var = ast_variable_browse(cfg, "mappings"); + if (!(var = ast_variable_browse(cfg, "mappings"))) { + ast_log(LOG_NOTICE, "No mappings found in " CONFIG ". Not logging CEL to custom CSVs.\n"); + } + while (var) { if (!ast_strlen_zero(var->name) && !ast_strlen_zero(var->value)) { struct cel_config *sink = ast_calloc_with_stringfields(1, struct cel_config, 1024); @@ -105,6 +109,8 @@ static int load_config(void) ast_string_field_build(sink, filename, "%s/%s/%s", ast_config_AST_LOG_DIR, name, var->name); ast_mutex_init(&sink->lock); + ast_verb(3, "Added CEL CSV mapping for '%s'.\n", sink->filename); + mappings += 1; AST_RWLIST_INSERT_TAIL(&sinks, sink, list); } else { ast_log(LOG_NOTICE, "Mapping must have both a filename and a format at line %d\n", var->lineno); @@ -113,6 +119,8 @@ static int load_config(void) } ast_config_destroy(cfg); + ast_verb(1, "Added CEL CSV mapping for %d files.\n", mappings); + return res; } |