Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
not catch KeyError
  • Loading branch information
jiasli committed Mar 24, 2021
commit 36625a1abfaf3ffa8047ee9bc4112e219fe9372a
5 changes: 1 addition & 4 deletions knack/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ def __init__(self, log_level_config, log_format, enable_color):
def format(self, record):
msg = logging.StreamHandler.format(self, record)
if self.enable_color:
try:
msg = self.wrap_with_color(record.levelname, msg)
except KeyError:
pass
msg = self.wrap_with_color(record.levelname, msg)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't ignore KeyError. As KeyError indicates color_map is corrupted.

return msg


Expand Down