feat(config): set DefaultMarkdownGenerator as the default markdown generator in CrawlerRunConfig

feat(logger): add color mapping for log message formatting options
This commit is contained in:
UncleCode
2025-04-03 20:34:19 +08:00
parent 86df20234b
commit 14894b4d70
2 changed files with 15 additions and 2 deletions

View File

@@ -156,9 +156,22 @@ class AsyncLogger(AsyncLoggerBase):
formatted_message = message.format(**params)
# Then apply colors if specified
color_map = {
"green": Fore.GREEN,
"red": Fore.RED,
"yellow": Fore.YELLOW,
"blue": Fore.BLUE,
"cyan": Fore.CYAN,
"magenta": Fore.MAGENTA,
"white": Fore.WHITE,
"black": Fore.BLACK,
"reset": Style.RESET_ALL,
}
if colors:
for key, color in colors.items():
# Find the formatted value in the message and wrap it with color
if color in color_map:
color = color_map[color]
if key in params:
value_str = str(params[key])
formatted_message = formatted_message.replace(