summaryrefslogtreecommitdiff
path: root/cdr
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2014-05-28 22:54:12 +0000
committerMatthew Jordan <mjordan@digium.com>2014-05-28 22:54:12 +0000
commitfb5690ce4b9ff896a56fe9b9eb9eeed1a2b5f028 (patch)
tree5fc5aa9c8099167cf81dc9cfdadb19ce3aa24743 /cdr
parent812f33d22218817f32ce856969e8196475f6d5fd (diff)
Logger/CLI/etc.: Fix some aesthetic issues; reduce chatty verbose messages
This patch addresses some aesthetic issues in Asterisk. These are all just minor tweaks to improve the look of the CLI when used in a variety of settings. Specifically: * A number of chatty verbose messages were removed or demoted to DEBUG messages. Verbose messages with a verbosity level of 5 or higher were - if kept as verbose messages - demoted to level 4. Several messages that were emitted at verbose level 3 were demoted to 4, as announcement of dialplan applications being executed occur at level 3 (and so the effects of those applications should generally be less). * Some verbose messages that only appear when their respective 'debug' options are enabled were bumped up to always be displayed. * Prefix/timestamping of verbose messages were moved to the verboser handlers. This was done to prevent duplication of prefixes when the timestamp option (-T) is used with the CLI. * Verbose magic is removed from messages before being emitted to non-verboser handlers. This prevents the magic in multi-line verbose messages (such as SIP debug traces or the output of DumpChan) from being written to files. * _Slightly_ better support for the "light background" option (-W) was added. This includes using ast_term_quit in the output of XML documentation help, as well as changing the "Asterisk Ready" prompt to bright green on the default background (which stands a better chance of being displayed properly than bright white). Review: https://reviewboard.asterisk.org/r/3547/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'cdr')
-rw-r--r--cdr/cdr_adaptive_odbc.c8
-rw-r--r--cdr/cdr_odbc.c5
-rw-r--r--cdr/cdr_pgsql.c5
-rw-r--r--cdr/cdr_sqlite3_custom.c2
4 files changed, 7 insertions, 13 deletions
diff --git a/cdr/cdr_adaptive_odbc.c b/cdr/cdr_adaptive_odbc.c
index a5a8b8588..72c26198f 100644
--- a/cdr/cdr_adaptive_odbc.c
+++ b/cdr/cdr_adaptive_odbc.c
@@ -196,7 +196,7 @@ static int load_config(void)
ast_trim_blanks(cdrvar);
}
- ast_verb(3, "Found filter %s'%s' for cdr variable %s in %s@%s\n", negate ? "!" : "", var->value, cdrvar, tableptr->table, tableptr->connection);
+ ast_verb(3, "Found filter %s'%s' for CDR variable %s in %s@%s\n", negate ? "!" : "", var->value, cdrvar, tableptr->table, tableptr->connection);
entry = ast_calloc(sizeof(char), sizeof(*entry) + strlen(cdrvar) + 1 + strlen(var->value) + 1);
if (!entry) {
@@ -281,7 +281,7 @@ static int load_config(void)
if (entry->octetlen == 0)
entry->octetlen = entry->size;
- ast_verb(10, "Found %s column with type %hd with len %ld, octetlen %ld, and numlen (%hd,%hd)\n", entry->name, entry->type, (long) entry->size, (long) entry->octetlen, entry->decimals, entry->radix);
+ ast_verb(4, "Found %s column with type %hd with len %ld, octetlen %ld, and numlen (%hd,%hd)\n", entry->name, entry->type, (long) entry->size, (long) entry->octetlen, entry->decimals, entry->radix);
/* Insert column info into column list */
AST_LIST_INSERT_TAIL(&(tableptr->columns), entry, list);
res = 0;
@@ -723,7 +723,7 @@ static int odbc_log(struct ast_cdr *cdr)
} else if (entry->filtervalue
&& ((!entry->negatefiltervalue && entry->filtervalue[0] != '\0')
|| (entry->negatefiltervalue && entry->filtervalue[0] == '\0'))) {
- ast_verb(4, "CDR column '%s' was not set and does not match filter of"
+ ast_log(AST_LOG_WARNING, "CDR column '%s' was not set and does not match filter of"
" %s'%s'. Cancelling this CDR.\n",
entry->cdrname, entry->negatefiltervalue ? "!" : "",
entry->filtervalue);
@@ -737,7 +737,7 @@ static int odbc_log(struct ast_cdr *cdr)
ast_str_append(&sql2, 0, ")");
ast_str_append(&sql, 0, "%s", ast_str_buffer(sql2));
- ast_verb(11, "[%s]\n", ast_str_buffer(sql));
+ ast_debug(3, "Executing [%s]\n", ast_str_buffer(sql));
stmt = ast_odbc_prepare_and_execute(obj, generic_prepare, ast_str_buffer(sql));
if (stmt) {
diff --git a/cdr/cdr_odbc.c b/cdr/cdr_odbc.c
index be07a8a56..2e86a06c4 100644
--- a/cdr/cdr_odbc.c
+++ b/cdr/cdr_odbc.c
@@ -252,9 +252,6 @@ static int odbc_load_module(int reload)
break;
}
- ast_verb(3, "cdr_odbc: dsn is %s\n", dsn);
- ast_verb(3, "cdr_odbc: table is %s\n", table);
-
if (!ast_test_flag(&config, CONFIG_REGISTERED)) {
res = ast_cdr_register(name, ast_module_info->description, odbc_log);
if (res) {
@@ -290,11 +287,9 @@ static int unload_module(void)
}
if (dsn) {
- ast_verb(11, "cdr_odbc: free dsn\n");
ast_free(dsn);
}
if (table) {
- ast_verb(11, "cdr_odbc: free table\n");
ast_free(table);
}
diff --git a/cdr/cdr_pgsql.c b/cdr/cdr_pgsql.c
index 6ac389788..8322da9b5 100644
--- a/cdr/cdr_pgsql.c
+++ b/cdr/cdr_pgsql.c
@@ -348,9 +348,8 @@ static int pgsql_log(struct ast_cdr *cdr)
LENGTHEN_BUF1(ast_str_strlen(sql2) + 2);
AST_RWLIST_UNLOCK(&psql_columns);
ast_str_append(&sql, 0, ")%s)", ast_str_buffer(sql2));
- ast_verb(11, "[%s]\n", ast_str_buffer(sql));
- ast_debug(2, "inserting a CDR record.\n");
+ ast_debug(3, "Inserting a CDR record: [%s]\n", ast_str_buffer(sql));
/* Test to be sure we're still connected... */
/* If we're connected, and connection is working, good. */
@@ -691,7 +690,7 @@ static int config_module(int reload)
/* For varchar columns, the maximum length is encoded in a different field */
flen = PQgetvalue(result, i, 5);
}
- ast_verb(4, "Found column '%s' of type '%s'\n", fname, ftype);
+
cur = ast_calloc(1, sizeof(*cur) + strlen(fname) + strlen(ftype) + 2);
if (cur) {
sscanf(flen, "%30d", &cur->len);
diff --git a/cdr/cdr_sqlite3_custom.c b/cdr/cdr_sqlite3_custom.c
index 83dac6a5d..435f4b37e 100644
--- a/cdr/cdr_sqlite3_custom.c
+++ b/cdr/cdr_sqlite3_custom.c
@@ -197,7 +197,7 @@ static int load_config(int reload)
return -1;
}
- ast_verb(3, "cdr_sqlite3_custom: Logging CDR records to table '%s' in 'master.db'\n", table);
+ ast_verb(4, "cdr_sqlite3_custom: Logging CDR records to table '%s' in 'master.db'\n", table);
ast_config_destroy(cfg);