23 #include "term_color.h" 24 #include "flex_ostream.h" 32 return (flex << esc_code);
34 catch (
const std::bad_cast& e)
40 boost::shared_ptr<goby::common::TermColor> goby::common::TermColor::inst_(
new TermColor());
42 goby::common::TermColor::TermColor()
44 boost::assign::insert(colors_map_)(
"nocolor", Colors::nocolor)(
"red", Colors::red)(
45 "lt_red", Colors::lt_red)(
"green", Colors::green)(
"lt_green", Colors::lt_green)(
46 "yellow", Colors::yellow)(
"lt_yellow", Colors::lt_yellow)(
"blue", Colors::blue)(
47 "lt_blue", Colors::lt_blue)(
"magenta", Colors::magenta)(
"lt_magenta", Colors::lt_magenta)(
48 "cyan", Colors::cyan)(
"lt_cyan", Colors::lt_cyan)(
"white", Colors::white)(
"lt_white",
51 boost::assign::insert(esc_code_map_)(esc_nocolor, Colors::nocolor)(esc_red, Colors::red)(
52 esc_lt_red, Colors::lt_red)(esc_green, Colors::green)(esc_lt_green, Colors::lt_green)(
53 esc_yellow, Colors::yellow)(esc_lt_yellow, Colors::lt_yellow)(esc_blue, Colors::blue)(
54 esc_lt_blue, Colors::lt_blue)(esc_magenta, Colors::magenta)(
55 esc_lt_magenta, Colors::lt_magenta)(esc_cyan, Colors::cyan)(esc_lt_cyan, Colors::lt_cyan)(
56 esc_white, Colors::white)(esc_lt_white, Colors::lt_white);
std::ostream & add_escape_code(std::ostream &os, const std::string &esc_code)
Forms the basis of the Goby logger: std::ostream derived class for holding the FlexOStreamBuf.
Converts between string, escape code, and enumeration representations of the terminal colors...