On Tue, Apr 19, 2011 at 12:32 PM, Roy Stogner <royst...@ices.utexas.edu> wrote: > > On Tue, 19 Apr 2011, John Peterson wrote: > >> On Tue, Apr 19, 2011 at 12:21 PM, Roy Stogner <royst...@ices.utexas.edu> >> wrote: >>> >>> "Useless pretty output change" is the svn log message for a recent >>> change Ben put into an application code, which now turns our tests >>> into a rainbow of colors! Blue for initial headers, green for >>> successful tests, red for failed tests. >>> >>> Anyone know if there's a more portable way to do that than outputting >>> cryptic "\033[01;31m" type terminal codes? Maybe curses? Because now >>> I totally want standard libMesh support for colorful pretty output. >> >> More portable I don't think so, more readable, yeah there probably is >> something... > > More readable I'm not worried about; we'd wrap it in "libmesh_red()" > or "libMesh::Color::red()" or something else designed to be handed off > to an ostream. It'd just be nice to do some sort of tty detection so > that when someone runs with a stdout that doesn't support color they > instead see black and white rather than garbage.
std::string term_type = std::getenv("TERM"); Then if it's one of the ones we recognize, e.g. xterm-color, go nuts with the colors? -- John ------------------------------------------------------------------------------ Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev _______________________________________________ Libmesh-devel mailing list Libmesh-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libmesh-devel