better logging for python client