Tidy up the api and make it easy to implement an alternate log writer