Extract error logging into a sinatra extension