MCPcopy Create free account
hub / github.com/aws/aws-cli / highlight

Method highlight

awscli/customizations/logs/ui.py:155–163  ·  view source on GitHub ↗
(self, log_event: str)

Source from the content-addressed store, hash-verified

153 return log_event[:start] + string_without_color + log_event[end:]
154
155 def highlight(self, log_event: str):
156 matchings = list(self._regex_pattern.finditer(log_event.lower()))[::-1]
157 self._occurrence_count += len(matchings)
158 for match in matchings:
159 log_event = self._add_color_to_string(
160 log_event, match.start(), match.end()
161 )
162
163 return log_event
164
165 def remove_highlighting(self, log_event: str):
166 matchings = list(

Calls 2

_add_color_to_stringMethod · 0.95
startMethod · 0.45

Tested by 3

test_highlightMethod · 0.64