Add diagnostic logging to the indexer. Fixes #113