Added logging.

Fixes #38