convert logger.debug and logger.info calls to take a block