Thanks On Tue, Dec 27, 2016 at 2:57 AM, gst <g.sta...@gmail.com> wrote:
> Le lundi 26 décembre 2016 10:34:48 UTC-5, Alec Taylor a écrit : > > So I'm putting .info in one StringIO and .error in another StringIO. > > > > How do I stop them from both being put into both? > > > > Code: http://ideone.com/Nj6Asz > > > Hi, > > it's doable with filter on the handlers: > > > def exact_filter(level): > def filter(record): > return level == record.levelno > filter.filter = filter > return filter > > stdout_stream.addFilter(exact_filter(logging.INFO)) > stderr_stream.addFilter(exact_filter(logging.ERROR)) > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list