-
Notifications
You must be signed in to change notification settings - Fork 845
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
Multiple calls to BlockLogs() permanently disable logging #5172
Comments
It's actually even more entertaining and random than that:
|
Ok, this happens because |
Yeah, that is what happens if you store both If you assign the Should we make |
I think the solution is simpler. For BlockLogs, we should only save the
state of logs that were initially enabled. I.e. only save the state of
logs we toggled to block.
Cheers,
Brian
…On Thu, Apr 7, 2022 at 10:18 AM Ric ***@***.***> wrote:
Yeah, that is what happens if you store both BlockLogs() on the same
variable: the second instance gets created before the first is destroyed.
Then, it gets assigned to the var, and the first is destroyed, and what you
mentioned happens.
If you assign the BlockLogs() to different variables, and then leave the
context... race condition, depending on which one gets cleaned up by the
garbage collector?
Should we make a LogStateSetter() a singleton, so that we can only have
one instance at a time, and always restore to the first state?
—
Reply to this email directly, view it on GitHub
<#5172 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACLOFIH32FDVVLWC42CZ2Y3VD3VEFANCNFSM5SWP3PVA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I like this solution... |
Found with Release 2020_03_1b1:
This is relevant because we do actually call
BlockLogs()
multiple times in places likerdkit/rdkit/Chem/Draw/__init__.py
Lines 447 to 460 in 67409c3
The text was updated successfully, but these errors were encountered: