Added Python Logging and made numerous syntax adjustments