Implemented a logger. Fixes #3.