Skip to content

Commit

Permalink
add clarifying comment
Browse files Browse the repository at this point in the history
  • Loading branch information
SYangster committed Jan 24, 2025
1 parent 704cb65 commit cd161c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nvflare/fuel/utils/log_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def format(self, record):
record.fl_ctx = ""
record.identity = ""
message = record.getMessage()
# attempting to parse fl ctx key value pairs "[key0=value0, key1=value1,... ]: " from message
fl_ctx_match = re.search(r"\[(.*?)\]: ", message)
if fl_ctx_match:
try:
Expand All @@ -105,7 +106,7 @@ def format(self, record):
record.msg = message.replace(fl_ctx_match[0], "")
self._style._fmt = self.fmt
except:
# found brackets pattern, but invalid fl_ctx
# found brackets pattern, but was not fl_ctx format
self.remove_empty_placeholders()
else:
self.remove_empty_placeholders()
Expand Down

0 comments on commit cd161c0

Please sign in to comment.