diff --git a/setup.py b/setup.py index 1dad1b6f..06a9d075 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup, find_packages setup( name = 'swarms', packages = find_packages(exclude=[]), - version = '0.4.5', + version = '0.4.6', license='MIT', description = 'Swarms - Pytorch', author = 'Kye Gomez', diff --git a/swarms/agents/workers/agents.py b/swarms/agents/workers/agents.py index fc4600ae..f96955ec 100644 --- a/swarms/agents/workers/agents.py +++ b/swarms/agents/workers/agents.py @@ -224,8 +224,7 @@ from langchain.callbacks.base import BaseCallbackHandler from langchain.schema import AgentAction, AgentFinish, LLMResult from celery import Task -from ansi import ANSI, Color, Style, dim_multiline -from logger import logger +from swarms.utils import ANSI, Color, Style, dim_multiline, logger class EVALCallbackHandler(BaseCallbackHandler): diff --git a/swarms/tools/main.py b/swarms/tools/main.py index e8c08f10..fa112730 100644 --- a/swarms/tools/main.py +++ b/swarms/tools/main.py @@ -23,17 +23,7 @@ from bs4 import BeautifulSoup # from logger import logger - -import logging - -logger = logging.getLogger() -formatter = logging.Formatter("%(message)s") -ch = logging.StreamHandler() -ch.setFormatter(formatter) -logger.addHandler(ch) - -logger.setLevel(logging.DEBUG) - +from swarms.utils import logger class ToolScope(Enum): GLOBAL = "global" diff --git a/swarms/utils/__init__.py b/swarms/utils/__init__.py index 8c47e910..c98f8253 100644 --- a/swarms/utils/__init__.py +++ b/swarms/utils/__init__.py @@ -1 +1,2 @@ -from swarms.utils.ansi import Code, Color, Style, ANSI, dim_multiline \ No newline at end of file +from swarms.utils.ansi import Code, Color, Style, ANSI, dim_multiline +from swarms.utils.logger import logger \ No newline at end of file diff --git a/swarms/utils/logger.py b/swarms/utils/logger.py new file mode 100644 index 00000000..ce97ae8b --- /dev/null +++ b/swarms/utils/logger.py @@ -0,0 +1,9 @@ +import logging + +logger = logging.getLogger() +formatter = logging.Formatter("%(message)s") +ch = logging.StreamHandler() +ch.setFormatter(formatter) +logger.addHandler(ch) + +logger.setLevel(logging.DEBUG)