-
Notifications
You must be signed in to change notification settings - Fork 15
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
[BUG] Strange logging behaviour #232
Comments
Thanks for this, I'll take a look tomorrow. Annoyingly logger settings persist across module imports, so if something is enabled or disabled in a dependency then it can affect your code. We've experienced this issue with some of our own dependencies, so it may well be one of those that's causing the issue here. |
I've fixed the redirection of stderr in this commit. However, I can't seem to solve the debug message issue, so assume that this is being disabled in one of our dependencies. (I'll look into this.) Currently, the only place that |
For reference, we previously disabled various logger messages for certain dependencies since people were posting issues regarding them. I decided to try and only keep the messages where they referred to actual functionality that we were using. |
@chryswoods: Here's a fix:
This sets the log level for the |
Okay that's great, thanks for fixing the re-direction issue! And glad the logging issue was easily identified as a product of sire, makes it easier to fix than a non-openbiosim dependency! |
[closes #142] [ref OpenBioSim/biosimspace#232]
Hi again,
I've been encountering some strange logging behaviour when using BSS. I have wrapped BSS within my own module and spent a fair bit of time trying to fix my code but I now think the issue may be arising because of BSS instead.
Any advice would be appreciated!
Thanks,
Noah
The issue
Simply, once I've imported BioSimSpace, I'm unable to create debug messages, i.e in my modules the syntax is:
However the debug message will not be printed. If I replace with logger.info('Info') then the message is printed
I have spent a while checking to see if I had to run extra steps to set up my logger, but I am now pretty sure (but not certain, and I apologise if I'm wrong) the issue is to do with the way BSS handles loggers.
Recreate the code
To recreate the code I am running this code block in a notebook. I have included the print / log statements below the code
Worth pointing out that once BSS is imported the logger is redirecting its statements to the output of the 'import BSS' cell. Also, as you can see here, the debug message is not being printed once BSS has been imported.
Example screenshots
Here are a pair of screenshots showing clearly what I'm referring too
Potential causes / solutions
I am able to prevent the re-direction of the log messages away from the import cell by adding the following to my main init.py script:
However I have been unable to write debug messages. Having a look through the source code I noticed the following few lines, which may or may not have something to do with the issue at hand:
(please complete the following information):
The text was updated successfully, but these errors were encountered: