diff --git a/mesop/env/env.py b/mesop/env/env.py index d8cfc6ffd..1feb753ec 100644 --- a/mesop/env/env.py +++ b/mesop/env/env.py @@ -1,4 +1,3 @@ -import logging import os from mesop.exceptions import MesopDeveloperException @@ -40,6 +39,3 @@ def get_app_base_path() -> str: EXPERIMENTAL_EDITOR_TOOLBAR_ENABLED = ( os.environ.get("MESOP_EXPERIMENTAL_EDITOR_TOOLBAR", "false").lower() == "true" ) - -if EXPERIMENTAL_EDITOR_TOOLBAR_ENABLED: - logging.info("Experiment enabled: EXPERIMENTAL_EDITOR_TOOLBAR_ENABLED") diff --git a/mesop/labs/text_to_text.py b/mesop/labs/text_to_text.py index 08baf2e6d..64f01f5f7 100644 --- a/mesop/labs/text_to_text.py +++ b/mesop/labs/text_to_text.py @@ -2,6 +2,7 @@ from typing import Callable, Generator, Literal, cast import mesop as me +from mesop.warn import warn @me.stateclass @@ -30,9 +31,7 @@ def text_io( - "append": Concatenates each new piece of text to the existing output. - "replace": Replaces the existing output with each new piece of text. """ - print( - "\033[93m[warning]\033[0m text_io is deprecated, use text_to_text instead" - ) + warn("text_io is deprecated, use text_to_text instead") text_to_text(transform=transform, title=title, transform_mode=transform_mode) diff --git a/mesop/warn/warn.py b/mesop/warn/warn.py index feed1d896..1b9dc5287 100644 --- a/mesop/warn/warn.py +++ b/mesop/warn/warn.py @@ -1,2 +1,7 @@ +import logging + +logger = logging.getLogger(__name__) + + def warn(message: str) -> None: - print("\033[93m[warning]\033[0m " + message) + logger.warning("\033[93m[warning]\033[0m " + message)