use python logging module for messages instead of print()

The `if debug` and `if not really` statements in this code are triggered by a command-line argument `--debug` set in initialize.sh. So I changed the logger code to use distinct logger configurations depending on whether the debug command line argument is set. Basically, the command-line argument and the logger level are now in alignment.