Move debug hash printing code to it's own function.