23 #ifndef LoggerManipulators20091110H 24 #define LoggerManipulators20091110H 29 #include "term_color.h" 40 inline std::ostream& die(std::ostream& os)
46 inline std::ostream& warn(std::ostream& os)
52 inline std::ostream& verbose(std::ostream& os) {
return (os); }
55 inline std::ostream& debug1(std::ostream& os) {
return (os <<
"D: "); }
58 inline std::ostream& debug2(std::ostream& os) {
return (os <<
"D2: "); }
61 inline std::ostream& debug3(std::ostream& os) {
return (os <<
"D3: "); }
71 Group(
const std::string& name =
"",
const std::string& description =
"",
73 : name_(name), description_(description), color_(color), enabled_(
true)
79 std::string name()
const {
return name_; }
91 void name(
const std::string& s) { name_ = s; }
92 void description(
const std::string& s) { description_ = s; }
94 void enabled(
bool b) { enabled_ = b; }
99 std::string description_;
110 explicit GroupSetter(
const std::string& s) : group_(s) {}
111 void operator()(std::ostream& os)
const;
129 std::ostream& basic_log_header(std::ostream& os,
const std::string& group_name);
Helper class for enabling the group(std::string) manipulator.
Forms the basis of the Goby logger: std::ostream derived class for holding the FlexOStreamBuf.
bool enabled() const
Is this group enabled?
Color
The eight terminal colors (and bold or "light" variants)
std::ostream & operator<<(std::ostream &out, const google::protobuf::Message &msg)
provides stream output operator for Google Protocol Buffers Message
std::ostream & red(std::ostream &os)
All text following this manipulator is red. (e.g. std::cout << red << "text";)
goby::common::Colors::Color color() const
Color to use when displaying this group (for streams that support terminal escape codes only: std::co...
The global namespace for the Goby project.
std::string description() const
Human readable description of this group.
std::ostream & nocolor(std::ostream &os)
All text following this manipulator is uncolored (e.g. std::cout << green << "green" << nocolor << "u...
Defines a group of messages to be sent to the Goby logger. For Verbosity == verbose streams...