Add documentation and refactor logObj
Add test for logObj