Another nit. Can we factor this out into another function to consolidate the `config.debug` test and log?