Switching to python logging module