add module level loggers

This commit is contained in:
onyx-and-iris 2023-06-23 03:45:03 +01:00
parent 064cfeb23d
commit 342a49804f
2 changed files with 6 additions and 4 deletions

View File

@ -1,14 +1,15 @@
import logging
from typing import Iterable, Union
logger = logging.getLogger(__name__)
class Event:
"""Keeps track of event subscriptions"""
logger = logging.getLogger("event.event")
def __init__(self, subs: dict):
self.subs = subs
self.logger = logger.getChild(self.__class__.__name__)
def info(self, msg=None):
info = (f"{msg} events",) if msg else ()

View File

@ -1,15 +1,16 @@
import logging
logger = logging.getLogger(__name__)
class Subject:
"""Adds support for observers"""
logger = logging.getLogger("subject.subject")
def __init__(self):
"""list of current observers"""
self._observers = list()
self.logger = logger.getChild(self.__class__.__name__)
@property
def observers(self) -> list: