[Asterisk-code-review] logging: Remove/fix some message annoyances (asterisk[13])
George Joseph
asteriskteam at digium.com
Wed Feb 3 14:10:57 CST 2016
George Joseph has uploaded a new change for review.
https://gerrit.asterisk.org/2182
Change subject: logging: Remove/fix some message annoyances
......................................................................
logging: Remove/fix some message annoyances
test_dlinklists doesn't need to NOTICE everyone that every macro worked.
res_phoneprov doesn't need to VERBOSE everyone that a phoneprov extension or
provider was registered.
res_odbc was missing a newline at the end of one message.
Change-Id: I6c06361518ef3711821795e535acd439782a995e
---
M res/res_odbc.c
M res/res_phoneprov.c
M tests/test_dlinklists.c
3 files changed, 28 insertions(+), 33 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/82/2182/1
diff --git a/res/res_odbc.c b/res/res_odbc.c
index 91b52bf..17b7a76 100644
--- a/res/res_odbc.c
+++ b/res/res_odbc.c
@@ -500,7 +500,7 @@
!strncasecmp(v->name, "share", 5) ||
!strcasecmp(v->name, "limit") ||
!strcasecmp(v->name, "idlecheck")) {
- ast_log(LOG_WARNING, "The 'pooling', 'shared_connections', 'limit', and 'idlecheck' options are deprecated. Please see UPGRADE.txt for information");
+ ast_log(LOG_WARNING, "The 'pooling', 'shared_connections', 'limit', and 'idlecheck' options are deprecated. Please see UPGRADE.txt for information\n");
} else if (!strcasecmp(v->name, "enabled")) {
enabled = ast_true(v->value);
} else if (!strcasecmp(v->name, "pre-connect")) {
diff --git a/res/res_phoneprov.c b/res/res_phoneprov.c
index 6986d20..b3d14f7 100644
--- a/res/res_phoneprov.c
+++ b/res/res_phoneprov.c
@@ -1476,7 +1476,6 @@
ao2_lock(providers);
i = ao2_iterator_init(providers, 0);
for(; (provider = ao2_iterator_next(&i)); ao2_ref(provider, -1)) {
- ast_log(LOG_VERBOSE, "Reloading provider '%s' users.\n", provider->provider_name);
if (provider->load_users()) {
ast_log(LOG_ERROR, "Unable to load provider '%s' users. Reload aborted.\n", provider->provider_name);
continue;
@@ -1553,7 +1552,6 @@
return -1;
}
- ast_log(LOG_VERBOSE, "Registered phoneprov provider '%s'.\n", provider_name);
return 0;
}
@@ -1606,7 +1604,6 @@
ast_phoneprov_delete_extensions(provider_name);
ao2_find(providers, provider_name, OBJ_SEARCH_KEY | OBJ_NODATA | OBJ_UNLINK);
- ast_log(LOG_VERBOSE, "Unegistered phoneprov provider '%s'.\n", provider_name);
}
int ast_phoneprov_add_extension(char *provider_name, struct varshead *vars)
@@ -1679,7 +1676,6 @@
ast_log(LOG_WARNING, "Could not create http routes for '%s' - skipping\n", user->macaddress);
return -1;
}
- ast_log(LOG_VERBOSE, "Created %s/%s for provider '%s'.\n", username, mac, provider_name);
ao2_link(users, user);
} else {
@@ -1698,7 +1694,6 @@
exten = delete_extension(exten);
return -1;
}
- ast_log(LOG_VERBOSE, "Added %s/%s for provider '%s'.\n", username, mac, provider_name);
}
return 0;
diff --git a/tests/test_dlinklists.c b/tests/test_dlinklists.c
index 197dd75..81760ac 100644
--- a/tests/test_dlinklists.c
+++ b/tests/test_dlinklists.c
@@ -70,7 +70,7 @@
strcat(buff," <=> ");
}
- ast_log(LOG_NOTICE,"Got: %s [expect %s]\n", buff, expect);
+ ast_debug(1,"Got: %s [expect %s]\n", buff, expect);
}
static void print_list_backwards(struct test_container *x, char *expect)
@@ -84,7 +84,7 @@
strcat(buff," <=> ");
}
- ast_log(LOG_NOTICE,"Got: %s [expect %s]\n", buff, expect);
+ ast_debug(1,"Got: %s [expect %s]\n", buff, expect);
}
static struct test_container *make_cont(void)
@@ -180,7 +180,7 @@
struct test1 *d;
struct test1 *e;
- ast_log(LOG_NOTICE,"Test AST_DLLIST_INSERT_HEAD, AST_DLLIST_TRAVERSE, AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_BEGIN, AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_END\n");
+ ast_debug(1,"Test AST_DLLIST_INSERT_HEAD, AST_DLLIST_TRAVERSE, AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_BEGIN, AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_END\n");
tc = make_cont();
a = make_test1("A");
b = make_test1("B");
@@ -197,9 +197,9 @@
tc = make_cont();
if (AST_DLLIST_EMPTY(&tc->entries))
- ast_log(LOG_NOTICE,"Test AST_DLLIST_EMPTY....OK\n");
+ ast_debug(1,"Test AST_DLLIST_EMPTY....OK\n");
else
- ast_log(LOG_NOTICE,"Test AST_DLLIST_EMPTY....PROBLEM!!\n");
+ ast_log(LOG_ERROR,"Test AST_DLLIST_EMPTY....PROBLEM!!\n");
a = make_test1("A");
@@ -207,7 +207,7 @@
c = make_test1("C");
d = make_test1("D");
- ast_log(LOG_NOTICE,"Test AST_DLLIST_INSERT_TAIL\n");
+ ast_debug(1,"Test AST_DLLIST_INSERT_TAIL\n");
AST_DLLIST_INSERT_TAIL(&tc->entries, a, list);
AST_DLLIST_INSERT_TAIL(&tc->entries, b, list);
AST_DLLIST_INSERT_TAIL(&tc->entries, c, list);
@@ -215,24 +215,24 @@
print_list(tc, "A <=> B <=> C <=> D");
if (AST_DLLIST_FIRST(&tc->entries) == a)
- ast_log(LOG_NOTICE,"Test AST_DLLIST_FIRST....OK\n");
+ ast_debug(1,"Test AST_DLLIST_FIRST....OK\n");
else
- ast_log(LOG_NOTICE,"Test AST_DLLIST_FIRST....PROBLEM\n");
+ ast_log(LOG_ERROR,"Test AST_DLLIST_FIRST....PROBLEM\n");
if (AST_DLLIST_LAST(&tc->entries) == d)
- ast_log(LOG_NOTICE,"Test AST_DLLIST_LAST....OK\n");
+ ast_debug(1,"Test AST_DLLIST_LAST....OK\n");
else
- ast_log(LOG_NOTICE,"Test AST_DLLIST_LAST....PROBLEM\n");
+ ast_log(LOG_ERROR,"Test AST_DLLIST_LAST....PROBLEM\n");
if (AST_DLLIST_NEXT(a,list) == b)
- ast_log(LOG_NOTICE,"Test AST_DLLIST_NEXT....OK\n");
+ ast_debug(1,"Test AST_DLLIST_NEXT....OK\n");
else
- ast_log(LOG_NOTICE,"Test AST_DLLIST_NEXT....PROBLEM\n");
+ ast_log(LOG_ERROR,"Test AST_DLLIST_NEXT....PROBLEM\n");
if (AST_DLLIST_PREV(d,list) == c)
- ast_log(LOG_NOTICE,"Test AST_DLLIST_PREV....OK\n");
+ ast_debug(1,"Test AST_DLLIST_PREV....OK\n");
else
- ast_log(LOG_NOTICE,"Test AST_DLLIST_PREV....PROBLEM\n");
+ ast_log(LOG_ERROR,"Test AST_DLLIST_PREV....PROBLEM\n");
destroy_test_container(tc);
@@ -243,35 +243,35 @@
c = make_test1("C");
d = make_test1("D");
- ast_log(LOG_NOTICE,"Test AST_DLLIST_INSERT_AFTER, AST_DLLIST_TRAVERSE_BACKWARDS\n");
+ ast_debug(1,"Test AST_DLLIST_INSERT_AFTER, AST_DLLIST_TRAVERSE_BACKWARDS\n");
AST_DLLIST_INSERT_HEAD(&tc->entries, a, list);
AST_DLLIST_INSERT_AFTER(&tc->entries, a, b, list);
AST_DLLIST_INSERT_AFTER(&tc->entries, b, c, list);
AST_DLLIST_INSERT_AFTER(&tc->entries, c, d, list);
print_list_backwards(tc, "D <=> C <=> B <=> A");
- ast_log(LOG_NOTICE,"Test AST_DLLIST_REMOVE_HEAD\n");
+ ast_debug(1,"Test AST_DLLIST_REMOVE_HEAD\n");
AST_DLLIST_REMOVE_HEAD(&tc->entries, list);
print_list_backwards(tc, "D <=> C <=> B");
- ast_log(LOG_NOTICE,"Test AST_DLLIST_REMOVE_HEAD\n");
+ ast_debug(1,"Test AST_DLLIST_REMOVE_HEAD\n");
AST_DLLIST_REMOVE_HEAD(&tc->entries, list);
print_list_backwards(tc, "D <=> C");
- ast_log(LOG_NOTICE,"Test AST_DLLIST_REMOVE_HEAD\n");
+ ast_debug(1,"Test AST_DLLIST_REMOVE_HEAD\n");
AST_DLLIST_REMOVE_HEAD(&tc->entries, list);
print_list_backwards(tc, "D");
AST_DLLIST_REMOVE_HEAD(&tc->entries, list);
if (AST_DLLIST_EMPTY(&tc->entries))
- ast_log(LOG_NOTICE,"Test AST_DLLIST_REMOVE_HEAD....OK\n");
+ ast_debug(1,"Test AST_DLLIST_REMOVE_HEAD....OK\n");
else
- ast_log(LOG_NOTICE,"Test AST_DLLIST_REMOVE_HEAD....PROBLEM!!\n");
+ ast_log(LOG_ERROR,"Test AST_DLLIST_REMOVE_HEAD....PROBLEM!!\n");
AST_DLLIST_INSERT_HEAD(&tc->entries, a, list);
AST_DLLIST_INSERT_AFTER(&tc->entries, a, b, list);
AST_DLLIST_INSERT_AFTER(&tc->entries, b, c, list);
AST_DLLIST_INSERT_AFTER(&tc->entries, c, d, list);
- ast_log(LOG_NOTICE,"Test AST_DLLIST_REMOVE\n");
+ ast_debug(1,"Test AST_DLLIST_REMOVE\n");
AST_DLLIST_REMOVE(&tc->entries, c, list);
print_list(tc, "A <=> B <=> D");
AST_DLLIST_REMOVE(&tc->entries, a, list);
@@ -281,9 +281,9 @@
AST_DLLIST_REMOVE(&tc->entries, b, list);
if (AST_DLLIST_EMPTY(&tc->entries))
- ast_log(LOG_NOTICE,"Test AST_DLLIST_REMOVE....OK\n");
+ ast_debug(1,"Test AST_DLLIST_REMOVE....OK\n");
else
- ast_log(LOG_NOTICE,"Test AST_DLLIST_REMOVE....PROBLEM!!\n");
+ ast_log(LOG_ERROR,"Test AST_DLLIST_REMOVE....PROBLEM!!\n");
AST_DLLIST_INSERT_HEAD(&tc->entries, a, list);
AST_DLLIST_INSERT_AFTER(&tc->entries, a, b, list);
@@ -295,11 +295,11 @@
}
AST_DLLIST_TRAVERSE_SAFE_END;
if (AST_DLLIST_EMPTY(&tc->entries))
- ast_log(LOG_NOTICE,"Test AST_DLLIST_REMOVE_CURRENT... OK\n");
+ ast_debug(1,"Test AST_DLLIST_REMOVE_CURRENT... OK\n");
else
- ast_log(LOG_NOTICE,"Test AST_DLLIST_REMOVE_CURRENT... PROBLEM\n");
+ ast_log(LOG_ERROR,"Test AST_DLLIST_REMOVE_CURRENT... PROBLEM\n");
- ast_log(LOG_NOTICE,"Test AST_DLLIST_MOVE_CURRENT, AST_DLLIST_INSERT_BEFORE_CURRENT\n");
+ ast_debug(1,"Test AST_DLLIST_MOVE_CURRENT, AST_DLLIST_INSERT_BEFORE_CURRENT\n");
AST_DLLIST_INSERT_HEAD(&tc->entries, a, list);
AST_DLLIST_INSERT_AFTER(&tc->entries, a, b, list);
AST_DLLIST_INSERT_AFTER(&tc->entries, b, c, list);
@@ -325,7 +325,7 @@
c = make_test1("C");
d = make_test1("D");
- ast_log(LOG_NOTICE,"Test: AST_DLLIST_MOVE_CURRENT_BACKWARDS and AST_DLLIST_INSERT_BEFORE_CURRENT_BACKWARDS\n");
+ ast_debug(1,"Test: AST_DLLIST_MOVE_CURRENT_BACKWARDS and AST_DLLIST_INSERT_BEFORE_CURRENT_BACKWARDS\n");
AST_DLLIST_INSERT_HEAD(&tc->entries, a, list);
AST_DLLIST_INSERT_AFTER(&tc->entries, a, b, list);
AST_DLLIST_INSERT_AFTER(&tc->entries, b, c, list);
--
To view, visit https://gerrit.asterisk.org/2182
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6c06361518ef3711821795e535acd439782a995e
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: George Joseph <george.joseph at fairview5.com>
More information about the asterisk-code-review
mailing list