use logging module instead of just print