Changing prints to logs