Skip to content

Commit

Permalink
Refined Logs per CR Recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
tshalvi committed Nov 12, 2023
1 parent 1ff6b55 commit 2b64b84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions sonic-xcvrd/xcvrd/xcvrd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down Expand Up @@ -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".
Expand Down
4 changes: 2 additions & 2 deletions sonic-xcvrd/xcvrd/xcvrd_utilities/media_settings_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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,
Expand Down

0 comments on commit 2b64b84

Please sign in to comment.