diff --git a/eo/src/utils/eoStdoutMonitor.cpp b/eo/src/utils/eoStdoutMonitor.cpp index be4de57a5..8fc6dc606 100644 --- a/eo/src/utils/eoStdoutMonitor.cpp +++ b/eo/src/utils/eoStdoutMonitor.cpp @@ -10,28 +10,41 @@ using namespace std; eoMonitor& eoStdoutMonitor::operator()(void) { - if (firsttime) - { - cout << "First Generation" << endl; - - firsttime = false; - - } - // ok, now the real saving. write out - if (!cout) { string str = "eoStdoutMonitor: Could not write to cout"; throw runtime_error(str); } - - for(iterator it = vec.begin(); it != vec.end(); ++it) + if (firsttime) { - cout << (*it)->longName() << ": " << (*it)->getValue() << '\n'; + if (verbose) + cout << "First Generation" << endl; + else + { + for(iterator it = vec.begin(); it != vec.end(); ++it) + { + cout << (*it)->longName() << delim; + } + cout << endl; + } + firsttime = false; } - - cout << "\n****** End of Generation ******\n" << endl; // endl: flush - + // ok, now the real saving. write out + if (verbose) + { + for(iterator it = vec.begin(); it != vec.end(); ++it) + { + cout << (*it)->longName() << ": " << (*it)->getValue() << '\n'; + } + cout << "\n****** End of Generation ******\n" << endl; + } + else // a one-liner + { + for(iterator it = vec.begin(); it != vec.end(); ++it) + { + cout << (*it)->getValue() << delim; + } + cout << endl; + } return *this; } - diff --git a/eo/src/utils/eoStdoutMonitor.h b/eo/src/utils/eoStdoutMonitor.h index b9667e6f4..63332ded5 100644 --- a/eo/src/utils/eoStdoutMonitor.h +++ b/eo/src/utils/eoStdoutMonitor.h @@ -38,12 +38,14 @@ class eoStdoutMonitor : public eoMonitor { public : - eoStdoutMonitor(std::string _delim = "\t") : delim(_delim), firsttime(true) {} + eoStdoutMonitor(bool _verbose=true, std::string _delim = "\t") : + verbose(_verbose), delim(_delim), firsttime(true) {} eoMonitor& operator()(void); private : - std::string delim; - bool firsttime; + bool verbose; + std::string delim; + bool firsttime; }; #endif