Formalize logging.

Fixes #11