Replace sys.exit with raise Stop
Replace print with log.{debug,info,warn,error}