Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loggable.logger returns a new logger each time, but is used as an object property #103

Open
bjkeller opened this issue Jun 8, 2021 · 0 comments

Comments

@bjkeller
Copy link
Member

bjkeller commented Jun 8, 2021

There are tests in test_loggable.py that are failing.

The root cause seems to be that Loggable.logger

def logger(self):

returns a new logger each time with the level set to ERROR, but it is used in other Loggable methods as if it were a property of the Loggable object.
For instance, in Loggable.set_level where each subsequent call to self.logger is a new logger.
With
self.logger.setLevel(level)

followed immediately by
for h in self.logger.handlers:

which means none of this is doing what it looks like it is doing.

I think Loggable either needs to be a factory, in which case it should store the parameters for loggers and handlers.
Or, it should manage a single logger object with its handlers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant