Use logging instead of print

Written by Berendt, rebased & modified slightly by Marti.
Use default 'python' in shebang, not 'python3'