I'm declaring and setting the log level on a logger object like this:
logger = logging.getLogger(__name__)
loglevel = 'DEBUG' # actually taken from a config in my code
logger.setLevel(logging.getLevelName(loglevel))
How can I set the log format in this case? I tried logger.setFormat and logger.setFormatter, they throw attribute errors.
Every guide I read talks about logging.basicConfig(format=FORMAT), but I'm using a logger and not calling directly logging.