added log-function (copied from tog.py)
improved logging
Merge branch 'feature/log' into dev
updated ip-function and main program flow