I'm having an issue configuring logging for multiple objects.
Presently, I have two classes representing a server
and a coordinator
. These are composed such that a coordinator
has a server
as in instance variable.
See below:
class Coordinator(object):
def __init__(self):
self.scheduler = asyncio.get_event_loop()
self.server = Server(..)
class Server(object):
def __init__(self, scheduler, host, port):
...
# Configure WebSocket logging
self.logger = logging.getLogger('websockets')
self.logger.setLevel(logging.DEBUG)
self.logger.addHandler(logging.StreamHandler())
...
Before I added the coordinator
class the logging in the server
class was able to extract the websockets values and display the output.
This no longer works. How can I resolve this issue, and add an additional logger to the Coordinator
class?
I'm using python 3.6.8
Thanks