Skip to content

Commit

Permalink
Troubleshooting log init
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Nov 30, 2023
1 parent f52450a commit e8819cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions chatbot_core/utils/bot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import yaml
from klat_connector import start_socket

from chatbot_core.utils.logger import LOG
from ovos_utils.log import LOG

# Causes circular imports
# from chatbot_core import ChatBot
Expand Down Expand Up @@ -661,7 +661,7 @@ def run_mq_bot(chatbot_name: str, vhost: str = '/chatbots',
@param init_kwargs: extra kwargs to pass to chatbot `__init__` method
@returns: Started ChatBotV2 instance
"""
from neon_utils.log_utils import LOG, init_log
from neon_utils.log_utils import init_log
init_log({"level_overrides": {"error": ['pika'],
"warning": ["filelock"]}})
os.environ['CHATBOT_VERSION'] = 'v2'
Expand Down
9 changes: 6 additions & 3 deletions chatbot_core/utils/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,23 @@
# US Patents 2008-2021: US7424516, US20140161250, US20140177813, US8638908, US8068604, US8553852, US10530923, US10530924
# China Patent: CN102017585 - Europe Patent: EU2156652 - Patents Pending

import logging
from ovos_utils.log import LOG
LOG.name = "chatbots"

# fmt = '%(asctime)s - %(levelname)-8s - %(name)s:%(filename)s:%(module)s:%(funcName)s:%(lineno)d - %(message)s'
# logging.basicConfig(level=logging.DEBUG, format=fmt, datefmt='%Y-%m-%d:%H:%M:%S')
LOG = logging.getLogger("chatbots")
# LOG = logging.getLogger("chatbots")
# logging.getLogger("socketio.client").setLevel(logging.WARNING)
# logging.getLogger("engineio.client").setLevel(logging.WARNING)
# logging.getLogger("urllib3").setLevel(logging.WARNING)


def make_logger(name, level=logging.DEBUG):
def make_logger(name, level=None):
"""
Create a logger with the specified name (used to create bot loggers)
"""
import logging
level = level or logging.DEBUG
logger = logging.getLogger(name)
logger.setLevel(level)
return logging.getLogger(name)

0 comments on commit e8819cf

Please sign in to comment.