From 42f178be9eb182576269192d5d67cf7d31d883c9 Mon Sep 17 00:00:00 2001 From: Wendong Date: Wed, 18 Dec 2024 19:56:00 +0800 Subject: [PATCH] fix: logger setting for print_text_animated --- camel/utils/commons.py | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/camel/utils/commons.py b/camel/utils/commons.py index 5e1565e16c..01eaa30284 100644 --- a/camel/utils/commons.py +++ b/camel/utils/commons.py @@ -12,7 +12,6 @@ # limitations under the License. # ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. ========= import importlib -import logging import os import platform import re @@ -40,19 +39,14 @@ import requests from pydantic import BaseModel -from camel.logger import get_logger from camel.types import TaskType from .constants import Constants F = TypeVar('F', bound=Callable[..., Any]) -logger = get_logger(__name__) - -def print_text_animated( - text, delay: float = 0.02, end: str = "", log_level: int = logging.INFO -): +def print_text_animated(text, delay: float = 0.02, end: str = ""): r"""Prints the given text with an animated effect. Args: @@ -61,22 +55,10 @@ def print_text_animated( (default: :obj:`0.02`) end (str, optional): The end character to print after each character of text. (default: :obj:`""`) - log_level (int, optional): The log level to use. - See https://docs.python.org/3/library/logging.html#levels - (default: :obj:`logging.INFO`) """ - if logger.isEnabledFor(log_level): - # timestamp and other prefixes - logger.log(log_level, '') - - for char in text: - print(char, end=end, flush=True) - time.sleep(delay) - # Close the log entry - logger.log(log_level, '') - else: - # This may be relevant for logging frameworks - logger.log(log_level, text) + for char in text: + print(char, end=end, flush=True) + time.sleep(delay) def get_prompt_template_key_words(template: str) -> Set[str]: