Skip to content

Commit

Permalink
Troubleshooting chatbot log init
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Jan 16, 2025
1 parent fc185af commit 242c391
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions chatbot_core/chatbot_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from typing import Optional
from ovos_config.config import Configuration

from neon_utils.logger import LOG
from neon_utils.log_utils import init_log


class ChatBotABC(ABC):
Expand All @@ -48,8 +48,10 @@ def __init__(self, bot_id: str, config: dict = None):
def log(self):
if not self.__log:
# Copy log to support multiple bots in thread with different names
self.__log = LOG.create_logger(self._bot_id)
LOG.info(f"Initialized logger with level: {self.__log.level}")
log = init_log(log_name="chatbots")
self.__log = log.create_logger(self._bot_id)
log.info(f"Initialized logger {self.__log.name} with level: "
f"{self.__log.level}")
name = f"{self._bot_id} - "
stack = inspect.stack()
record = stack[2]
Expand Down

0 comments on commit 242c391

Please sign in to comment.