These are chat archives for astropy/astropy
log.infoshow something like "function blah() in setup.py INFO:" ?
out of meeting now, here’s an example, if I understand what you’re looking for? Or maybe it helps get you to it?
from astropy import logger
from logging import Formatter
test.log now has:
hmm, I don’t see a convenient way to change the format once the logger has been created. You can grab the astropy logger and add new handlers or delete the ones there, or set the formatter statement in the astropy.cfg file in ~/.astropy/config/astropy.cfg to include the funcName.
If you want to do it live in code, the default logger has a StreamHandler, you could delete that (but you don’t have to) and replace it with your own if you want, still about the same code:
from astropy import log, logger
[log.removeHandler(f) for f in log.handlers if isinstance(f, logger.StreamHandler)]
There’s probably someone here with better knowledge about the logging system than me that might have more suggestions…..