replacing print() by logging api