Replaces all prints with logging.