On 29 May, 15:53, "Lowell Alleman" <[EMAIL PROTECTED]> wrote:
> Is there any reason not to do this assignment in the "myhandler.py"
> directly?  This would save a step for each application that needs to
> use it.
>
> Starting from your example, it would now look like this:
>
> # -- myhandler.py ---
> importlogging.handlers
>
> class MySpecialHandler(logging.handlers.RotatingFileHandler):
>     def __init__(self, fn):
>        logging.handlers.RotatingFileHandler.__init__(self, fn,
>            maxBytes=2000, backupCount=3)
>
> # Register handler in the "logging.handlers" 
> namespacelogging.handlers.MySpecialHandler = MySpecialHandler
>
> # -- app.py ---
> importlogging.handlers,logging.config
> import myhandler
>
> logging.config.fileConfig("logging.ini")
> ...

Doing it the way you suggest should be fine.

Regards,

Vinay Sajip
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to