MCPcopy
hub / github.com/OpenBMB/AgentVerse / format

Method format

agentverse/logging.py:256–274  ·  view source on GitHub ↗
(self, record: LogRecord)

Source from the content-addressed store, hash-verified

254 """
255
256 def format(self, record: LogRecord) -> str:
257 if hasattr(record, "color"):
258 record.title_color = (
259 getattr(record, "color")
260 + getattr(record, "title", "")
261 + " "
262 + Style.RESET_ALL
263 )
264 else:
265 record.title_color = getattr(record, "title", "")
266
267 # Add this line to set 'title' to an empty string if it doesn't exist
268 record.title = getattr(record, "title", "")
269
270 if hasattr(record, "msg"):
271 record.message_no_color = remove_color_codes(getattr(record, "msg"))
272 else:
273 record.message_no_color = ""
274 return super().format(record)
275
276
277def remove_color_codes(s: str) -> str:

Callers

nothing calls this directly

Calls 2

remove_color_codesFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected