Added Python-logging (#76) and callbacks for flushing (#78)