Use logger instead of print to report error