real time logging in py3