Separate debug log with info config
[platform/core/connectivity/stc-manager.git] / src / monitor / stc-monitor-app.c
old mode 100644 (file)
new mode 100755 (executable)
index 96d602a..ceeb0b4
@@ -363,7 +363,7 @@ API stc_error_e stc_monitor_app_add(uint32_t classid,
 
        lookup_value = g_hash_table_lookup(apps, GUINT_TO_POINTER(classid));
        if (lookup_value) {
-               if (STC_DEBUG_LOG)
+               if (STC_DEBUG_LOG && STC_STAT_LOG)
                        STC_LOGE("Already exists [\033[1;36m%d\033[0;m:"
                                                "\033[0;32m%s\033[0;m]", classid, app_id);
                return STC_ERROR_NONE;
@@ -371,7 +371,7 @@ API stc_error_e stc_monitor_app_add(uint32_t classid,
 
        app_value = MALLOC0(stc_app_value_s, 1);
        if (!app_value) {
-               if (STC_DEBUG_LOG)
+               if (STC_DEBUG_LOG && STC_STAT_LOG)
                        STC_LOGE("Value allocation failed");
                return STC_ERROR_OUT_OF_MEMORY;
        }
@@ -411,7 +411,7 @@ API stc_error_e stc_monitor_app_add(uint32_t classid,
 
        stc_monitor_rstn_add_for_app(classid);
 
-       if (STC_DEBUG_LOG) {
+       if (STC_DEBUG_LOG && STC_STAT_LOG) {
                __print_app(GUINT_TO_POINTER(classid), app_value, NULL);
                STC_LOGD("\033[1;32mApplication added\033[0;m "
                        "[\033[1;36m%d\033[0;m]", classid);
@@ -570,7 +570,7 @@ API stc_error_e stc_monitor_app_remove(uint32_t classid, const char *app_id)
 
        app_lookup = g_hash_table_lookup(apps, GUINT_TO_POINTER(classid));
        if (!app_lookup) {
-               if (STC_DEBUG_LOG)
+               if (STC_DEBUG_LOG && STC_STAT_LOG)
                        STC_LOGD("Application not found [\033[1;36m%d\033[0;m]", classid);
                return STC_ERROR_FAIL;
        }
@@ -589,7 +589,7 @@ API stc_error_e stc_monitor_app_remove(uint32_t classid, const char *app_id)
        /* remove ristrictions if any */
        stc_monitor_rstn_remove_for_app(classid);
 
-       if (STC_DEBUG_LOG)
+       if (STC_DEBUG_LOG && STC_STAT_LOG)
                __print_app(GUINT_TO_POINTER(classid), app_lookup, NULL);
 
        /* remove app_key from the stc-manager */