From 2b64b841905f859659defc088d1fbde2141b611c Mon Sep 17 00:00:00 2001 From: tshalvi Date: Sun, 12 Nov 2023 12:14:44 +0000 Subject: [PATCH] Refined Logs per CR Recommendations --- sonic-xcvrd/xcvrd/xcvrd.py | 9 ++++++--- .../xcvrd/xcvrd_utilities/media_settings_parser.py | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/sonic-xcvrd/xcvrd/xcvrd.py b/sonic-xcvrd/xcvrd/xcvrd.py index bd59329fc..361a2874b 100644 --- a/sonic-xcvrd/xcvrd/xcvrd.py +++ b/sonic-xcvrd/xcvrd/xcvrd.py @@ -755,6 +755,9 @@ def __init__(self, namespaces, port_mapping, main_thread_stop_event, skip_cmis_m self.skip_cmis_mgr = skip_cmis_mgr self.namespaces = namespaces + def log_debug(self, message): + helper_logger.log_debug("CMIS: {}".format(message)) + def log_notice(self, message): helper_logger.log_notice("CMIS: {}".format(message)) @@ -1421,11 +1424,11 @@ def task_worker(self): lane_speed = int(speed/1000)//host_lane_count optics_si_dict = optics_si_parser.fetch_optics_si_setting(pport, lane_speed, sfp) - helper_logger.log_debug("Read SI parameters for port {} from optics_si_settings.json vendor file:".format(lport)) + self.log_debug("Read SI parameters for port {} from optics_si_settings.json vendor file:".format(lport)) for key, sub_dict in optics_si_dict.items(): - helper_logger.log_debug("{}".format(key)) + self.log_debug("{}".format(key)) for sub_key, value in sub_dict.items(): - helper_logger.log_debug("{}: {}".format(sub_key, str(value))) + self.log_debug("{}: {}".format(sub_key, str(value))) if optics_si_dict: self.log_notice("{}: Apply Optics SI found for Vendor: {} PN: {} lane speed: {}G". diff --git a/sonic-xcvrd/xcvrd/xcvrd_utilities/media_settings_parser.py b/sonic-xcvrd/xcvrd/xcvrd_utilities/media_settings_parser.py index cc2c5c227..93d1b63d0 100644 --- a/sonic-xcvrd/xcvrd/xcvrd_utilities/media_settings_parser.py +++ b/sonic-xcvrd/xcvrd/xcvrd_utilities/media_settings_parser.py @@ -300,7 +300,7 @@ def notify_media_setting(logical_port_name, transceiver_dict, ganged_member_num += 1 key = get_media_settings_key(physical_port, transceiver_dict, port_speed, lane_count) - helper_logger.log_debug("Retrieving media settings for port {} using the following keys: {}".format(logical_port_name, key)) + helper_logger.log_debug("Retrieving media settings for port {}, operating at a speed of {} with a lane count of {}, using the following lookup keys: {}".format(logical_port_name, port_speed, lane_count, key)) media_dict = get_media_settings_value(physical_port, key) if len(media_dict) == 0: @@ -310,7 +310,7 @@ def notify_media_setting(logical_port_name, transceiver_dict, fvs = swsscommon.FieldValuePairs(len(media_dict)) index = 0 - helper_logger.log_debug("Storing in Application DB the following media settings for port {}:".format(logical_port_name)) + helper_logger.log_debug("Publishing ASIC-side SI setting for port {} in APP_DB:".format(logical_port_name)) for media_key in media_dict: if type(media_dict[media_key]) is dict: media_val_str = get_media_val_str(num_logical_ports,