Replace print with a logger to output on stderr