Enhanced logging and added a test for it: Addresses Issue #8