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

Steven D'Aprano steve+python at pearwood.info
Tue Aug 9 07:59:07 EDT 2016


On Tue, 9 Aug 2016 08:56 pm, berteh at gmail.com wrote:

> Hello.
> 
> My python script should run on Linux, Win and MacOS, but I can't find a
> way to have logging.conf configuration that works out of the box accross
> all these OSes.

Oh! Wait, I didn't pick up on the logging.conf part! D'oh!

> [handler_file]
> class=handlers.RotatingFileHandler
> args=('scribusGenerator.log','a','maxBytes=1000','backupCount=1')

Try using '~/scribusGenerator.log' to specify the user's home directory.




-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.




More information about the Python-list mailing list