Use buffer traits over specific IDs
[platform/core/system/dlog.git] / src / logctl / logctl.c
index 903d4e6..4b101ed 100644 (file)
@@ -13,6 +13,7 @@
 #include <sys/stat.h>
 
 // DLog
+#include <buffer_config.h>
 #include <buffer_traits.h>
 #include <dynamic_config.h>
 #include <logconfig.h>
@@ -745,19 +746,12 @@ int handle_dump(const struct parsed_params *params, const char *config_path, str
                return ret;
 
        printf("\nLogging buffer status:\n");
-       const bool plog_default = log_config_get_boolean(conf, "plog", true);
-       const bool limiter_apply_to_all_buffers = log_config_get_boolean(conf, "limiter_apply_to_all_buffers", false);
        for (int i = 0; i < LOG_ID_MAX; ++i) {
-               char key[MAX_CONF_KEY_LEN];
-               ret = snprintf(key, sizeof key, "enable_%s", log_name_by_id((log_id_t)i));
-               if (ret < 0)
-                       continue;
-
                bool stdout_enabled;
                ret = (is_pipe ? get_stdout_one_pipe : get_stdout_one_nonpipe)(i, conf, &stdout_enabled);
                printf("* %s (regular): %s\n"
                        , log_name_by_id((log_id_t)i)
-                       , log_config_get_boolean(conf, key, (i != LOG_ID_APPS || limiter_apply_to_all_buffers) ? plog_default : true) ? "ENABLED" : "DISABLED"
+                       , is_buffer_enabled((log_id_t) i, conf) ? "ENABLED" : "DISABLED"
                );
                printf("* %s (stdout): %s\n"
                        , log_name_by_id((log_id_t)i)