Set STC_DEBUG_LOG flag
[platform/core/connectivity/stc-manager.git] / src / helper / helper-nfacct-rule.c
index a2a598f..a8474a1 100755 (executable)
@@ -156,7 +156,9 @@ stc_error_e nfacct_send_del(nfacct_rule_s *counter)
 {
        struct genl req;
 
+#if STC_DEBUG_LOG
        STC_LOGD("send remove request for %s", counter->name);
+#endif
 
        prepare_netlink_msg(&req, NFNL_MSG_ACCT_DEL, NLM_F_ACK);
        add_string_attr(&req, counter->name, NFACCT_NAME);
@@ -432,7 +434,9 @@ static bool is_rule_present(const char *cmd_buf)
                strncpy(exec_buf + (cmd_pos - cmd_buf), IPTABLES_CHECK,
                        sizeof(IPTABLES_CHECK) - 1);
 
+#if STC_DEBUG_LOG
                STC_LOGD("check rule %s", exec_buf);
+#endif
 
                args = g_strsplit_set(exec_buf, " ", -1);
 
@@ -468,8 +472,9 @@ stc_error_e exec_iptables_cmd(const char *cmd_buf, pid_t *cmd_pid)
                int ret;
                char *save_ptr = NULL;
 
-               STC_LOGD("executing iptables cmd %s in forked process",
-                        cmd_buf);
+#if STC_DEBUG_LOG
+               STC_LOGD("executing iptables cmd %s in forked process", cmd_buf);
+#endif
 
                if (is_rule_present(cmd_buf)) {
                        STC_LOGD("Rule %s already present", cmd_buf);
@@ -518,8 +523,9 @@ stc_error_e exec_ip6tables_cmd(const char *cmd_buf, pid_t *cmd_pid)
                int ret;
                char *save_ptr = NULL;
 
-               STC_LOGD("executing ip6tables cmd %s in forked process",
-                        cmd_buf);
+#if STC_DEBUG_LOG
+               STC_LOGD("executing ip6tables cmd %s in forked process", cmd_buf);
+#endif
 
                if (is_rule_present(cmd_buf)) {
                        STC_LOGD("Rule %s already present", cmd_buf);