]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Don't output debug unless we asked for it
authorOlle Johansson <oej@edvina.net>
Thu, 8 Feb 2007 23:18:59 +0000 (23:18 +0000)
committerOlle Johansson <oej@edvina.net>
Thu, 8 Feb 2007 23:18:59 +0000 (23:18 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53672 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/acl.c

index 9000300f36641d0dbc63dce00d7ba248fbf51b22..5d8c82380c0e64448059eb37a7923c5ce3c34abc 100644 (file)
@@ -196,7 +196,8 @@ struct ast_ha *ast_append_ha(char *sense, char *stuff, struct ast_ha *path)
                        ret = ha;
                }
        }
-       ast_log(LOG_DEBUG, "%s/%s appended to acl for peer\n", stuff, nm);
+       if (option_debug)
+               ast_log(LOG_DEBUG, "%s/%s appended to acl for peer\n", stuff, nm);
        return ret;
 }
 
@@ -210,7 +211,8 @@ int ast_apply_ha(struct ast_ha *ha, struct sockaddr_in *sin)
                /* DEBUG */
                ast_copy_string(iabuf, ast_inet_ntoa(sin->sin_addr), sizeof(iabuf));
                ast_copy_string(iabuf2, ast_inet_ntoa(ha->netaddr), sizeof(iabuf2));
-               ast_log(LOG_DEBUG, "##### Testing %s with %s\n", iabuf, iabuf2);
+               if (option_debug)
+                       ast_log(LOG_DEBUG, "##### Testing %s with %s\n", iabuf, iabuf2);
                /* For each rule, if this address and the netmask = the net address
                   apply the current rule */
                if ((sin->sin_addr.s_addr & ha->netmask.s_addr) == ha->netaddr.s_addr)