diff options
Diffstat (limited to 'autogpts/autogpt/autogpt/logs/utils.py')
-rw-r--r-- | autogpts/autogpt/autogpt/logs/utils.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/autogpts/autogpt/autogpt/logs/utils.py b/autogpts/autogpt/autogpt/logs/utils.py new file mode 100644 index 000000000..d9f39af30 --- /dev/null +++ b/autogpts/autogpt/autogpt/logs/utils.py @@ -0,0 +1,9 @@ +import re + + +def remove_color_codes(s: str) -> str: + return re.sub(r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])", "", s) + + +def fmt_kwargs(kwargs: dict) -> str: + return ", ".join(f"{n}={repr(v)}" for n, v in kwargs.items()) |