cross-platform logging.config: how to set cross platform log (handlers) file location?

Berteh BE berteh at gmail.com
Wed Aug 10 16:56:40 EDT 2016


Thanks Peter for the insights that args are passed to eval().
Thanks Steven for the suggestion that ´~/' may actually work in windows.

Combining both I'm now successfully using the following in my logging.conf configuration file, that works in both *nix and Windows:

[handler_file]
class=handlers.RotatingFileHandler
args=(os.path.expanduser('~/.scribusGenerator.log'),'a','maxBytes=50','backupCount=1')

The tilde without an explicit call to expanduser() was not working in Windows... but with it it's working like a charm.

Thank you.



More information about the Python-list mailing list