Add logging and replace printed messages with logging calls.
Ignore logs and temporary files.