Add write_format fn that allows for a basic formatter implementation