Updated to use Python logging module