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

Replace python logger with twisted log #15

Open
wants to merge 1 commit into
base: d873c76e
Choose a base branch
from

Conversation

mahendra
Copy link

Python logging uses blocking APIs. Hence it must not be used in twisted code. A blocking log message can block the entire twisted event loop.

Refer to: http://twistedmatrix.com/documents/10.2.0/core/howto/logging.html#auto3

Although there is a twisted observer for this, it is still a blocking API. It is not a good practice to use it. (if somebody configures a db based log, it will block).

Python logging uses blocking APIs. Hence it must not be used in
twisted code. A blocking log message can block the entire twisted
event loop.

Refer to:
http://twistedmatrix.com/documents/10.2.0/core/howto/logging.html#auto3
@williamsjj
Copy link
Collaborator

I don't think it's a bad idea to swap in the Twisted logger. That said the Twisted logger also blocks unless you're using the syslog observer. I made an attempt at fixing this in Twisted but got bogged down in the inane review process. If Sean is alright with this direction I'd advocate integrating it. His call though since he's working on the logging refactor.

@objcode
Copy link
Owner

objcode commented Mar 22, 2011

Twisted logging looks good, will merge once I get a chance to make some of the new log lines grepable with prefixes.

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

Successfully merging this pull request may close these issues.

3 participants