-
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
Info messages do not appear when QM is used #1041
Comments
Unfortunately, the logger is somewhat global, so it gets complex if a library is affecting it in an improper way.
Qibolab is also a library, so we may consider stopping logging (unless we find a strong motivation, and we make sure of doing it consistently). And if it's not very relevant, it is definitely a simplification. (Btw, in 0.2 there is a function providing the estimate, with more or less the same input of |
I played a bit with this, mainly out of curiosity, and I found the following: import logging
import qm
log = logging.getLogger("mylogger")
handler = logging.StreamHandler()
log.addHandler(handler)
log.setLevel(logging.INFO)
log.info("test") successfully prints import logging
log = logging.getLogger("mylogger")
import qm
handler = logging.StreamHandler()
log.addHandler(handler)
log.setLevel(logging.INFO)
log.info("test") the A clear fix it to have Another fix is to redefine a new logger with a new name (the original is destroyed by The most appropriate solution is to report to QM and hope that a later version will be more friendly to other library loggers. Since we don't know when this will happen, if this is urgent I can try the fix described above. I believe the main issue caused by this is that we cannot see the |
I'd say it's not urgent, as I still believe Qibolab should not log (as QM should not do it as well), and at most provide the tools for the downstream to log what needed. Reporting is definitely appropriate (it is not difficult to find out why it's happening: despite the repo not being open, the code released is Python, and we can read it from the distributed package - but it's also a useless waste of time, at this level).
Indeed, this could be an issue even when the logger will be moved to downstream (to Qibocal, and even more to the application code), but it could be easily patched by turning the log into a bare print - possibly on the standard error, but still with a different mechanism than the Python standard library logger. |
It seems that the logger from the
qm
library is somehow disabling alllog.info
messages (withfrom qibo.config import log
), such as the one inplatform.execute
showing the expected execution time.I am trying to fix this for some time without success, so I open an issue for now.
Maybe not related, but it may also be a good idea to get rid of
qibo.config
completely in 0.2.The text was updated successfully, but these errors were encountered: