Refactored Logger to accept object and formatter