Backporting log level AttributeError bug fix