Go to the documentation of this file.
25 #ifndef GOBY_UTIL_DEBUG_LOGGER_FLEX_OSTREAMBUF_H
26 #define GOBY_UTIL_DEBUG_LOGGER_FLEX_OSTREAMBUF_H
38 #include <boost/date_time.hpp>
68 extern std::recursive_mutex
mutex;
100 void name(
const std::string& s) { name_ = s; }
139 void display(std::string& s);
140 void strip_escapes(std::string& s);
143 std::deque<std::string> buffer_;
148 StreamConfig(std::ostream* os,
logger::Verbosity verbosity) : os_(os), verbosity_(verbosity)
154 std::ostream* os()
const {
return os_; }
163 std::string group_name_;
165 std::map<std::string, logger::Group> groups_;
167 std::atomic<bool> die_flag_;
168 std::atomic<logger::Verbosity> current_verbosity_;
170 FlexNCurses* curses_;
171 std::shared_ptr<std::thread> input_thread_;
173 boost::posix_time::ptime start_time_;
175 std::vector<StreamConfig> streams_;
179 std::atomic<logger::Verbosity> highest_verbosity_;
181 std::atomic<logger_lock::LockAction> lock_action_;
static const Verbosity DEBUG3
Defines a group of messages to be sent to the Goby logger. For Verbosity == verbose streams,...
void add_group(const std::string &name, logger::Group g)
add a new group
static const Verbosity WARN
static const Verbosity VERBOSE
Forms the basis of the Goby logger: std::ostream derived class for holding the FlexOStreamBuf.
The global namespace for the Goby project.
bool is_quiet() const
do all attached streams have Verbosity == quiet?
std::recursive_mutex mutex
int sync()
virtual inherited from std::streambuf. Called when std::endl or std::flush is inserted into the strea...
void name(const std::string &s)
name of the application being served
LockAction
Mutex actions available to the Goby logger (glogger)
FlexOStreamBuf(FlexOstream *parent)
void refresh()
refresh the display (does nothing if !is_gui())
logger_lock::LockAction lock_action()
static const Verbosity DEBUG2
void set_die_flag(bool b)
exit on error at the next call to sync()
bool is_gui() const
is there an attached stream with Verbosity == gui (ncurses GUI)
static const Verbosity DEBUG1
void set_verbosity_depth(logger::Verbosity depth)
void add_stream(logger::Verbosity verbosity, std::ostream *os)
add a stream to the logger
logger::Verbosity highest_verbosity() const
static const Verbosity QUIET
void group_name(const std::string &s)
current group name (last insertion of group("") into the stream)
void set_lock_action(logger_lock::LockAction lock_action)
boost::units::quantity< boost::units::si::length > depth(boost::units::quantity< PressureUnit > pressure, boost::units::quantity< LatitudeUnit > latitude)
Calculates depth from pressure and latitude Adapted from "Algorithms for computation of fundamental p...
logger::Verbosity verbosity_depth()
int overflow(int c=EOF)
virtual inherited from std::streambuf. Called when something is inserted into the stream
void remove_stream(std::ostream *os)
remove a stream from the logger