I would use log() instead of print here.