Replace printing with a mako template to format the console output.