Add logging, make minor changes to error handling

A console logger is now installed in preprocess.py and util.py