Use package/module level logging.
Fix issue with tuple out of range in error case due to incorrect format string.