Added the logger functionality
Fixes #22