Hi! Isn't it just basicConfig?
>
> import logging
> logging.basicConfig(
> filename='test.log',
> format='[%(asctime)s] %(name)s %(levelname)s: %(message)s',
> level=logging.DEBUG,
> )
> log = logging.getLogger("TEST")
>
BasicConfig does not allow different settings for different log readers, as
I can see. E.g.
import logging
logging.basicConfig(
level=logging.DEBUG,
)
log1 = logging.getLogger("TEST1")
logging.basicConfig(
level=logging.INFO,
)
log2 = logging.getLogger("TEST2")
Here log2 will write out logs at the same level as log1, so basicConfic is
IMO too basic for a lot of use cases and so you'll have to go through the
other more verbose setup.
So, this getLogReader function would be more general than basicConfig, but
also much more useful. (But please educate me, if I've misunderstood
basicConfig)
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/