Add a proper logger

Previously, there was a mix of just print messages. Fix this to use a
real python logger.