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

Logging is inconsistent/broken inside the 'embed' environment. #685

Open
jettisonjoe opened this issue May 19, 2017 · 2 comments
Open

Logging is inconsistent/broken inside the 'embed' environment. #685

jettisonjoe opened this issue May 19, 2017 · 2 comments

Comments

@jettisonjoe
Copy link

@jettisonjoe jettisonjoe commented May 19, 2017

Log lines seldom print (if at all) from interactive environment created with a call to embed().

Example (broken) code using bpython:

import logging
import bpython

logging.basicConfig()
l = logging.getLogger()
l.critical('before')
bpython.embed(locals())
l.critical('after')

Output from bpython example:

CRITICAL:root:before
>>> l.critical('inside')
>>> 
CRITICAL:root:after

This is in contrast to the behavior from, say, IPython, which prints log lines correctly.

Example (working) code using IPython:

import logging
import IPython

logging.basicConfig()
l = logging.getLogger()
l.critical('before')
IPython.embed(locals=locals())
l.critical('after')

Output from IPython example:

CRITICAL:root:before
...
In [1]: l.critical('inside')
CRITICAL:root:inside

In [2]:
Do you really want to exit ([y]/n)

CRITICAL:root:after
@thomasballinger
Copy link
Member

@thomasballinger thomasballinger commented Jun 7, 2017

Is this related to #658 maybe?

@jettisonjoe
Copy link
Author

@jettisonjoe jettisonjoe commented Jun 7, 2017

Possibly, but that issue specifically calls out "Python 3.4 & 3.5" while I observed this behavior on Python 2.7.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.