diff options
author | Russell Bryant <russell@russellbryant.com> | 2007-07-26 15:49:18 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2007-07-26 15:49:18 +0000 |
commit | f8483a0d04f73e9d4c4f665efd5397cf96b17510 (patch) | |
tree | de4bd130dafa592858306d2ac6bcc5f85fd51cc8 /main/config.c | |
parent | 51e7035dfeca1def3070ca65f18153ee1d340ba9 (diff) |
Do a massive conversion for using the ast_verb() macro
(closes issue #10277, patches by mvanbaak)
Basically, this changes ...
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3, "Something\n");
to ...
ast_verb(3, "Something\n");
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/config.c')
-rw-r--r-- | main/config.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/main/config.c b/main/config.c index e9ba97fcc..4ce77798c 100644 --- a/main/config.c +++ b/main/config.c @@ -825,20 +825,16 @@ static struct ast_config *config_text_file_load(const char *database, const char ast_log(LOG_WARNING, "'%s' is not a regular file, ignoring\n", fn); continue; } - if (option_verbose > 1) { - ast_verbose(VERBOSE_PREFIX_2 "Parsing '%s': ", fn); + ast_verb(2, "Parsing '%s': ", fn); fflush(stdout); - } if (!(f = fopen(fn, "r"))) { ast_debug(1, "No file to parse: %s\n", fn); - if (option_verbose > 1) - ast_verbose( "Not found (%s)\n", strerror(errno)); + ast_verb(2, "Not found (%s)\n", strerror(errno)); continue; } count++; ast_debug(1, "Parsing %s\n", fn); - if (option_verbose > 1) - ast_verbose("Found\n"); + ast_verb(2, "Found\n"); while (!feof(f)) { lineno++; if (fgets(buf, sizeof(buf), f)) { @@ -971,8 +967,7 @@ int config_text_file_save(const char *configfile, const struct ast_config *cfg, #else if ((f = fopen(fn, "w"))) { #endif - if (option_verbose > 1) - ast_verbose(VERBOSE_PREFIX_2 "Saving '%s': ", fn); + ast_verb(2, "Saving '%s': ", fn); fprintf(f, ";!\n"); fprintf(f, ";! Automatically generated configuration file\n"); if (strcmp(configfile, fn)) @@ -1024,12 +1019,11 @@ int config_text_file_save(const char *configfile, const struct ast_config *cfg, #endif cat = cat->next; } - if ((option_verbose > 1) && !option_debug) - ast_verbose("Saved\n"); + if (!option_debug) + ast_verb(2, "Saved\n"); } else { ast_debug(1, "Unable to open for writing: %s\n", fn); - if (option_verbose > 1) - ast_verbose(VERBOSE_PREFIX_2 "Unable to write (%s)", strerror(errno)); + ast_verb(2, "Unable to write (%s)", strerror(errno)); return -1; } fclose(f); @@ -1078,9 +1072,7 @@ static int append_mapping(char *name, char *driver, char *database, char *table) } map->next = config_maps; - if (option_verbose > 1) - ast_verbose(VERBOSE_PREFIX_2 "Binding %s to %s/%s/%s\n", - map->name, map->driver, map->database, map->table ? map->table : map->name); + ast_verb(2, "Binding %s to %s/%s/%s\n", map->name, map->driver, map->database, map->table ? map->table : map->name); config_maps = map; return 0; |