Go to the documentation of this file.
25 #ifndef GOBY_UTIL_DEBUG_LOGGER_LOGGER_MANIPULATORS_H
26 #define GOBY_UTIL_DEBUG_LOGGER_LOGGER_MANIPULATORS_H
43 inline std::ostream&
die(std::ostream& os)
49 inline std::ostream&
warn(std::ostream& os)
55 inline std::ostream&
verbose(std::ostream& os) {
return (os); }
58 inline std::ostream&
debug1(std::ostream& os) {
return (os <<
"D: "); }
61 inline std::ostream&
debug2(std::ostream& os) {
return (os <<
"D2: "); }
64 inline std::ostream&
debug3(std::ostream& os) {
return (os <<
"D3: "); }
79 std::string
name()
const {
return name_; }
91 void name(
const std::string& s) { name_ = s; }
99 std::string description_;
117 std::ostream&
basic_log_header(std::ostream& os,
const std::string& group_name);
119 std::ostream&
operator<<(std::ostream& os,
const Group& g);
132 using goby::util::logger::operator<<;
std::ostream & die(std::ostream &os)
label stream as "error"
Defines a group of messages to be sent to the Goby logger. For Verbosity == verbose streams,...
Color
The eight terminal colors (and bold or "light" variants)
Forms the basis of the Goby logger: std::ostream derived class for holding the FlexOStreamBuf.
The global namespace for the Goby project.
std::string name() const
Name of this group (used in the group manipulator)
GroupSetter(std::string s)
std::string description() const
Human readable description of this group.
goby::util::logger::GroupSetter group(std::string n)
std::ostream & red(std::ostream &os)
All text following this manipulator is red. (e.g. std::cout << red << "text";)
void description(const std::string &s)
std::ostream & debug2(std::ostream &os)
label stream as "debug2"
std::ostream & basic_log_header(std::ostream &os, const std::string &group_name)
used for non tty ostreams (everything but std::cout / std::cerr) as the header for every line
Group(std::string name="", std::string description="", goby::util::Colors::Color color=goby::util::Colors::nocolor)
goby::util::Colors::Color color() const
Color to use when displaying this group (for streams that support terminal escape codes only: std::co...
void name(const std::string &s)
std::ostream & operator<<(std::ostream &os, const Group &g)
void operator()(std::ostream &os) const
Helper class for enabling the group(std::string) manipulator.
std::ostream & warn(std::ostream &os)
label stream as "warning"
bool enabled() const
Is this group enabled?
void color(goby::util::Colors::Color c)
std::ostream & nocolor(std::ostream &os)
All text following this manipulator is uncolored (e.g. std::cout << green << "green" << nocolor << "u...
std::ostream & verbose(std::ostream &os)
label stream as "verbose"
std::ostream & debug3(std::ostream &os)
label stream as "debug3"
std::ostream & debug1(std::ostream &os)
label stream as "debug1"