[issue33897] Add a restart option to logging.basicConfig()

2018-07-11 Thread michael kearney
michael kearney added the comment: Thank you! I just stumbled into this problem with logging.basicConfig. In the course of trying to find an acceptable workaround I discovered issue 33897 . I downloaded 3.8.0 and voila my problem is solved. So, I'll tread lightly, advance to 3.7.0, and keep

[issue33897] Add a restart option to logging.basicConfig()

2018-06-24 Thread Vinay Sajip
Change by Vinay Sajip : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue33897] Add a restart option to logging.basicConfig()

2018-06-24 Thread Vinay Sajip
Vinay Sajip added the comment: New changeset cf67d6a934b51b1f97e72945b596477b271f70b8 by Vinay Sajip (Dong-hee Na) in branch 'master': bpo-33897: Add a 'force' keyword argument to logging.basicConfig(). (GH-7873) https://github.com/python/cpython/commit/cf67d6a934b51b1f97e72945b596477b271f70b

[issue33897] Add a restart option to logging.basicConfig()

2018-06-23 Thread Vinay Sajip
Vinay Sajip added the comment: OK, let's go with "force", then. There are plenty of other places in Python where it's used, so there's that: https://github.com/python/cpython/search?l=Python&q=force -- ___ Python tracker

[issue33897] Add a restart option to logging.basicConfig()

2018-06-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: Not sure what the best word would be (freshen, update, reconfigure, reset, and restart all communicate the intent). I can't think of a simple word that accurately describes the implementation which removes and closes all root handlers. -- _

[issue33897] Add a restart option to logging.basicConfig()

2018-06-23 Thread Vinay Sajip
Vinay Sajip added the comment: > Perhaps "clear_handlers" or "replace_handlers" would be more self-descriptive. Except that it doesn't *just* clear the handlers - the act of clearing also lets e.g. the level to be set and the formatting to be set by the call. --

[issue33897] Add a restart option to logging.basicConfig()

2018-06-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Raymond, what do you think about "force" from a pedagogical > point of view? "force" is also good. Perhaps "clear_handlers" or "replace_handlers" would be more self-descriptive. -- ___ Python tracker

[issue33897] Add a restart option to logging.basicConfig()

2018-06-23 Thread Dong-hee Na
Change by Dong-hee Na : -- keywords: +patch pull_requests: +7480 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list

[issue33897] Add a restart option to logging.basicConfig()

2018-06-22 Thread Dong-hee Na
Dong-hee Na added the comment: "force" +1 -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue33897] Add a restart option to logging.basicConfig()

2018-06-22 Thread Vinay Sajip
Vinay Sajip added the comment: You would just clear all handlers added to the root logger before calling the existing code: try: # new code to be added, not tested for h in root.handlers[:]: root.removeHandler(h) h.close() # existing code

[issue33897] Add a restart option to logging.basicConfig()

2018-06-21 Thread Dong-hee Na
Dong-hee Na added the comment: Can I take a look at this issue? One question, if we pass the restart keyword as true, should we clear all handlers before we call basicConfig?, or should we maintain it? -- nosy: +corona10 ___ Python tracker

[issue33897] Add a restart option to logging.basicConfig()

2018-06-18 Thread Raymond Hettinger
New submission from Raymond Hettinger : Once a logger or basicConfig() has been called, later calls to basicConfig() are silent ignored. The makes it very difficult to experiment with or teach the various options at the interactive prompt or in a Jupyter notebook. What we have: >>> impo