Add detailed debug output to the rescan process