index: Generalize logged statements in BaseIndex.
Summary:
backported fourth commit (f376a4924) from PR13243
https://github.com/bitcoin/bitcoin/commit/f376a4924
Depends on D2935
Test Plan: make check
Reviewers: #bitcoin_abc, deadalnix, jasonbcox, Fabien
Reviewed By: #bitcoin_abc, deadalnix
Maniphest Tasks: T630
Differential Revision: https://reviews.bitcoinabc.org/D2936