Add the loglevel patch from #1875