log queries if debug >= 3