L
Logan
Is there actually a good reason why the StreamHandler and the
FileHandler are in the core package and all other handlers are
in logging.handlers?
I first did not realize this when reading the documentation of
the logging package and wrote a script which used:
from logging import FileHandler
When I changed the script to use the 'RotatingFileHandler', I
did not figure out that I had to use
from logging.handlers import RotatingFileHandler
until I read the source code of the logging package. And only
after I had a look at 'handlers.py', I thought that this must
be described in the documentation; so I read the documentation
again and finally found it. (Well, actually on the first page,
but that page is quite long
So, yes, it was my fault (did not read the documentation line
by line). But: why was the package designed in that way?
FileHandler are in the core package and all other handlers are
in logging.handlers?
I first did not realize this when reading the documentation of
the logging package and wrote a script which used:
from logging import FileHandler
When I changed the script to use the 'RotatingFileHandler', I
did not figure out that I had to use
from logging.handlers import RotatingFileHandler
until I read the source code of the logging package. And only
after I had a look at 'handlers.py', I thought that this must
be described in the documentation; so I read the documentation
again and finally found it. (Well, actually on the first page,
but that page is quite long
So, yes, it was my fault (did not read the documentation line
by line). But: why was the package designed in that way?