[Twisted-Python] twistd and loglevel question
i couldn't find anything in docs/source, but just want to double-check... am i correct that there is nothing in `twistd` that will automatically set the (normal) python logging level based on args/env vars?
On Dec 22, 2016, at 9:42 AM, Jonathan Vanasco <twisted-python@2xlp.com> wrote:
i couldn't find anything in docs/source, but just want to double-check...
am i correct that there is nothing in `twistd` that will automatically set the (normal) python logging level based on args/env vars?
By "normal" I assume you mean stdlib? No, we don't use stdlib logging. -glyph
On Dec 22, 2016, at 3:33 PM, Glyph Lefkowitz wrote:
By "normal" I assume you mean stdlib? No, we don't use stdlib logging.
-glyph
Yes, thanks! I just realized that "if I don't do anything at all", all the standard library's logging calls (all imported 3rd party packages) wind up on stdout. i wanted to make sure there wasn't something on the `twistd` that i was missing.
On Dec 22, 2016, at 1:40 PM, Jonathan Vanasco <twisted-python@2xlp.com> wrote:
On Dec 22, 2016, at 3:33 PM, Glyph Lefkowitz wrote:
By "normal" I assume you mean stdlib? No, we don't use stdlib logging.
-glyph
Yes, thanks!
I just realized that "if I don't do anything at all", all the standard library's logging calls (all imported 3rd party packages) wind up on stdout.
i wanted to make sure there wasn't something on the `twistd` that i was missing.
Nope. If you want interaction with stdlib logging, there's https://twistedmatrix.com/documents/16.6.0/api/twisted.logger.STDLibLogObser... <https://twistedmatrix.com/documents/16.6.0/api/twisted.logger.STDLibLogObser...> and some associated utilites. But that's up to you, not twistd. (Maybe twistd should start doing something to integrate the log streams?) -glyph
On Dec 22, 2016, at 5:00 PM, Glyph Lefkowitz wrote:
Nope. If you want interaction with stdlib logging, there's https://twistedmatrix.com/documents/16.6.0/api/twisted.logger.STDLibLogObser... and some associated utilites. But that's up to you, not twistd. (Maybe twistd should start doing something to integrate the log streams?)
thanks; I had seen that. I didn't want any actual interaction... just to silence all the DEBUG lines. i thought twistd might have registered something I could take advantage of. all I needed to do, for now, was throw this in my twisted app: import logging logging.basicConfig() logger = logging.getLogger() logger.setLevel(logging.WARNING) i can work out a proper solution in the new year.
On Dec 22, 2016, at 2:38 PM, Jonathan Vanasco <twisted-python@2xlp.com> wrote:
On Dec 22, 2016, at 5:00 PM, Glyph Lefkowitz wrote:
Nope. If you want interaction with stdlib logging, there's https://twistedmatrix.com/documents/16.6.0/api/twisted.logger.STDLibLogObser... <https://twistedmatrix.com/documents/16.6.0/api/twisted.logger.STDLibLogObser...> and some associated utilites. But that's up to you, not twistd. (Maybe twistd should start doing something to integrate the log streams?)
thanks; I had seen that. I didn't want any actual interaction... just to silence all the DEBUG lines. i thought twistd might have registered something I could take advantage of.
all I needed to do, for now, was throw this in my twisted app:
import logging logging.basicConfig() logger = logging.getLogger() logger.setLevel(logging.WARNING)
i can work out a proper solution in the new year.
Looking forward to reviewing your ticket, then :) -g
participants (2)
-
Glyph Lefkowitz
-
Jonathan Vanasco