-
Notifications
You must be signed in to change notification settings - Fork 50
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
refactor setting loggers #243
Conversation
CI as well as intensive tests running locally pass. Should we add additional logger tests? |
@janosh thanks for the contribution! What additional tests did you have in mind? we already have some in utils test_log but I'd be open to adding some more, provided they add some utility. I will have to review this pr a bit more before merging but all looks good on first glance. Also ill link #204 here as well since those issues might be related |
Ah, I'd only seen |
@janosh that is a good idea, I think that can be done relatively easy in test_pipeline! Regarding this PR though, all seems good except the |
That's interesting. I'd be curious to know why. Also, if we use Just to be clear, you're suggesting something like: import logging
if type(new_logger) != logging.Logger:
raise TypeError("Received invalid logger") |
@janosh no I am not suggesting that. sorry I should have been clearer. I mean no type checking at all if we can avoid it (sometimes we can't). My order of preferences is So for this time it's ok to if not isinstance(new_logger, logging.Logger):
raise TypeError("Logger argument must be a logging.Logger object or subclass!") But in general type checking is not good practice (I am still trying to undo many |
I'm just going to merge for now |
Ah, now I see. I would have certainly happy to leave out the type checking completely. Sorry for my confusion. |
Summary
Closes #242. Turned into a little bit more of a refactor than I had intended but should make the logger more user accessible.