autodisc: improve logging
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 26 Aug 2019 20:24:21 +0000 (16:24 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 27 Aug 2019 04:01:50 +0000 (00:01 -0400)
Improve the logging in the support_info_query_all_sources function:

- Include the group after a successful query
- Include the group when announcing the winner
- Format messages according to our standard, "message: key=value, ...".

Change-Id: I9833ea63314cde912c1da56d6ed2483f34783f17
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1976
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/autodisc/autodisc.c

index 1b15c1a18cd3b4aa927ea1514be7eafd578a1bb4..05b5ed25f2006cbaaa319ec3fdae14a6706eccc8 100644 (file)
@@ -496,9 +496,9 @@ auto_source_discovery_internal_status support_info_query_all_sources(
                                }
 
                                BT_LOGD("babeltrace.support-info query: success: component-class-name=source.%s.%s, input=%s, "
-                                       "type=%s, weight=%f\n",
+                                       "type=%s, weight=%f, group=%s\n",
                                        bt_plugin_get_name(plugin), bt_component_class_get_name(cc), input,
-                                       input_type, weight);
+                                       input_type, weight, group_value ? bt_value_string_get(group_value) : "(none)");
 
                                if (weight > winner.weigth) {
                                        winner.source = source_cc;
@@ -536,8 +536,8 @@ auto_source_discovery_internal_status support_info_query_all_sources(
                plugin_name = bt_plugin_get_name(winner.plugin);
                group = winner.group ? bt_value_string_get(winner.group) : NULL;
 
-               BT_LOGI("Input %s is awarded to component class source.%s.%s with weight %f",
-                       input, plugin_name, source_name, winner.weigth);
+               BT_LOGI("Input awarded: input=%s, type=%s, component-class-name=source.%s.%s, weight=%f, group=%s",
+                       input, input_type, plugin_name, source_name, winner.weigth, group ? group : "(none)");
 
                status = auto_source_discovery_add(auto_disc, plugin_name,
                        source_name, group, input, original_input_index, log_level);
@@ -545,7 +545,7 @@ auto_source_discovery_internal_status support_info_query_all_sources(
                        goto error;
                }
        } else {
-               BT_LOGI("Input %s (%s) was not recognized by any source component class.",
+               BT_LOGI("Input not recognized: input=%s, type=%s",
                        input, input_type);
                status = AUTO_SOURCE_DISCOVERY_INTERNAL_STATUS_NO_MATCH;
        }
This page took 0.029419 seconds and 4 git commands to generate.