switch to logger.debug, also moving options into their own function to clean up the handler