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

[PYTHON] Fix log_level on the python implementation (using pybind's logging functions) #92

Closed
axsaucedo opened this issue Nov 9, 2020 · 4 comments · Fixed by #118
Closed
Labels
bug Something isn't working python

Comments

@axsaucedo
Copy link
Member

axsaucedo commented Nov 9, 2020

Currently the log_level function only seems to work in certain contexts, will be required to fix and potentially add tests that ensrue it works as expected.

Edit:
It would also be possible to use some of the pybind utilities to perform the logging in a way that is consistent with the Python space https://pybind11.readthedocs.io/en/stable/advanced/pycpp/utilities.html#capturing-standard-output-from-ostream

@axsaucedo axsaucedo added the bug Something isn't working label Nov 9, 2020
@axsaucedo axsaucedo changed the title Fix log_level on the python implementation [PYTHON] Fix log_level on the python implementation Nov 9, 2020
@alexander-g
Copy link
Contributor

The current logging system writes directly to stdout. This is problematic for some use cases like interactive Jupyter sessions because the stdout is only displayed in the console and not in the browser. I suggest to directly use Python's logging module. That way the user can configure it as they want in a pythonic way.

@axsaucedo
Copy link
Member Author

@alexander-g I remember seeing a mention about this in the pybind documentation, totally agree, best to do this. I'll update the name of this issue.

@axsaucedo axsaucedo changed the title [PYTHON] Fix log_level on the python implementation [PYTHON] Fix log_level on the python implementation (using pybind's logging functions) Jan 16, 2021
@jomiq
Copy link

jomiq commented Jan 24, 2021

I can’t stop the logger from spamming info to stdout.log_level(i) does not seem to have any effect. Is this related to this issue or should I open a new ticket?

@alexander-g
Copy link
Contributor

Yes, it is related.
I have already almost fixed it. Will write a PR soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working python
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants