Adding unit test and completed code for logger