Question on PEP 337
Hy guys, this PEP is very well written, and I have found the discussion inspiring. Every time I use the logging module, I have the configuration hardcoded in the application. That is why I never used the configuration file based approach. Now I will give it a try. I think we should discuss the following scenario (it was not clear in the PEP for me) : an application has the logging configuration in a config file and it is currently running. The user edits this file, so the configuiration in the running process should be changed. -- How will be the logging mechanism reconfigured? -- How can the logging module guarantee that there will be no data loss during the reconfiguration process? Regards, Gabor -- Linux: Choice of a GNU Generation -- http://mail.python.org/mailman/listinfo/python-list
Re: Question on PEP 337
Gabor Urban urbangabo at gmail.com writes: this PEP is very well written, and I have found the discussion inspiring. Every time I use the logging module, I have the configuration hardcoded in the application. That is why I never used the configuration file based approach. Now I will give it a try. Are you talking about PEP 337 (Logging Usage in the Standard Library) or PEP 391 (Dictionary-Based Configuration For Logging) ? Based on the body of your post (rather than the title) you would appear to be talking about 391 rather than 337. PEP 337 is about changing the stdlib to make more use of logging internally. PEP 391 is about a new configuration approach for logging, using dicts. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list
Re: Question on PEP 337 (Vinay Sajip)
Hy guys, Sorry, Vinay Sajip was right. I wrote my questions about PEP 391. I would like to know your ideas about my questions posted in my last mail. Gabor -- Linux: Choice of a GNU Generation -- http://mail.python.org/mailman/listinfo/python-list
Re: Question on PEP 337
Gabor Urban urbangabo at gmail.com writes: Hy guys, this PEP is very well written, and I have found the discussion inspiring. Every time I use the logging module, I have the configuration hardcoded in the application. That is why I never used the configuration file based approach. Now I will give it a try. I think we should discuss the following scenario (it was not clear in the PEP for me) : an application has the logging configuration in a config file and it is currently running. The user edits this file, so the configuiration in the running process should be changed. You would have to do this by hand: watch for file changes, reload the file into a dict, call logging.config.dictConfig with the new dict. PEP 391 is basically about using a dict to configure logging, but doesn't say where the dict comes from - it could be from deserializing a YAML or JSON file or importing a Python source file, or it could be received as a pickle over the wire and unpickled ... the logging package only knows about the dict and this must follow the schema described in the PEP. Regards, Vinay Sajip -- http://mail.python.org/mailman/listinfo/python-list