Andrius Laukavičius <anlauka...@gmail.com> added the comment: Peter Otten thanks for examples, though with capture_output function, I had a little bit different intentions.
At first I actually did similarly as you described in case 2, where I called BasicConfig explicitly. Then I could specify where to redirect stream and what to do after I was done with capturing stderr (just reset back where it would be on default). Though I actually wanted to just capture stdout and stderr indirectly, meaning I don't want to specifically initiate logging object or modify it. I mean, I want to just capture any stdout/stderr that would be outputed while running some function that was passed via `target` argument (in my capture_output function). In this case, some function that I capture output from, might have some different way to handle sys.stderr (e.g. different basicConfig or some other implementation where sys.stderr is handled?). So it is not possible to consistently manage stderr when it involves logging library without explicitly "manage" it? P.S. don't know if I'm clear enough, so please ask me to clarify anything if its not clear..:) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36193> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com