My code looks like this
import logging formatter = logging.Formatter("{asctime} - {name} - {levelname} - {message}", "%d-%b-%y %H:%M", "{") def _add_handler(handler: logging.StreamHandler) -> logging.StreamHandler: handler.setFormatter(formatter) handler.setLevel(20) return handler logging.basicConfig( handlers={ _add_handler(logging.FileHandler("filename.log")), _add_handler(logging.StreamHandler()) }) logging.info("hello world") What this is supposed to do is log "hello world" both to the console and a file named filename.log, with a severity of INFO, which is what the 20 in the setLevel method is for. However, nothing is being logged at all. Where have I gone wrong?