Refactor logging so that it isn't global.