using python logger with exceptions and removed extra libraries