I think here we could do simpler

     level = getattr(logging, settings.LOG_LEVEL, "INFO")  # Automatically maps text string to the logging level, defaults to INFO