Add logging (used in record and prune only, for now.)