added the ability to pass in a custom logger