Unifying print and logging messages