Use python's logging module.