Logging

Includes #4.