Substituting prints with logging messages, to keep tests clean