func decorator to pretty printer and test example