logging: Remove/fix some message annoyances
authorGeorge Joseph <george.joseph@fairview5.com>
Wed, 3 Feb 2016 20:07:07 +0000 (13:07 -0700)
committerGeorge Joseph <george.joseph@fairview5.com>
Wed, 3 Feb 2016 20:11:11 +0000 (14:11 -0600)
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

res/res_odbc.c
res/res_phoneprov.c
tests/test_dlinklists.c

index 609d68a..81e1b3c 100644 (file)
@@ -500,7 +500,7 @@ static int load_odbc_config(void)
                                                !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")) {
index cf566b3..51c0b4a 100644 (file)
@@ -1476,7 +1476,6 @@ static int reload(void)
        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 @@ int ast_phoneprov_provider_register(char *provider_name,
                return -1;
        }
 
-       ast_log(LOG_VERBOSE, "Registered phoneprov provider '%s'.\n", provider_name);
        return 0;
 }
 
@@ -1606,7 +1604,6 @@ void ast_phoneprov_provider_unregister(char *provider_name)
 
        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 @@ int ast_phoneprov_add_extension(char *provider_name, struct varshead *vars)
                        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 @@ int ast_phoneprov_add_extension(char *provider_name, struct varshead *vars)
                        exten = delete_extension(exten);
                        return -1;
                }
-               ast_log(LOG_VERBOSE, "Added %s/%s for provider '%s'.\n", username, mac, provider_name);
        }
 
        return 0;
index a449508..581bf4d 100644 (file)
@@ -70,7 +70,7 @@ static void print_list(struct test_container *x, char *expect)
                        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 @@ static void print_list_backwards(struct test_container *x, char *expect)
                        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 @@ static void dll_tests(void)
        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 @@ static void dll_tests(void)
        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 @@ static void dll_tests(void)
        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 @@ static void dll_tests(void)
        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 @@ static void dll_tests(void)
        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 @@ static void dll_tests(void)
        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 @@ static void dll_tests(void)
        }
        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 @@ static void dll_tests(void)
        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);