use foreach on c++11 to write log lines to the log print functions; fallback to iterators on msvs 10