class mrpt::apps::RawlogGrabberApp
Overview
RawlogGrabber application wrapper class.
If the environment variable MRPT_HWDRIVERS_VERBOSE=1 is defined before calling initialize(), verbosity level will be changed to LVL_DEBUG.
#include <mrpt/apps_cli/RawlogGrabberApp.h> class RawlogGrabberApp: public mrpt::system::COutputLogger { public: // fields std::mutex params_mtx; double run_for_seconds = 0; bool show_sensor_thread_exceptions = true; mrpt::config::CConfigFileMemory params; std::mutex results_mtx; std::string rawlog_filename; std::size_t rawlog_saved_objects = 0; // construction RawlogGrabberApp(); // methods void initialize(int argc, const char** argv); void initialize( int argc, char** argv ); void run(); bool isRunning() const; void SensorThread(std::string sensor_label); };
Inherited Members
public: // structs struct TMsg; // fields bool logging_enable_console_output {true}; bool logging_enable_keep_record {false}; // methods void logStr(const VerbosityLevel level, std::string_view msg_str) const; void logFmt(const VerbosityLevel level, const char* fmt, ...) const; void void logCond(const VerbosityLevel level, bool cond, const std::string& msg_str) const; void setLoggerName(const std::string& name); std::string getLoggerName() const; void setVerbosityLevel(const VerbosityLevel level); void setVerbosityLevelForCallbacks(const VerbosityLevel level); void setMinLoggingLevel(const VerbosityLevel level); VerbosityLevel getMinLoggingLevel() const; VerbosityLevel getMinLoggingLevelForCallbacks() const; bool isLoggingLevelVisible(VerbosityLevel level) const; void getLogAsString(std::string& log_contents) const; std::string getLogAsString() const; void writeLogToFile(const std::optional<std::string>& fname_in = std::nullopt) const; void dumpLogToConsole() const; std::string getLoggerLastMsg() const; void getLoggerLastMsg(std::string& msg_str) const; void loggerReset(); void logRegisterCallback(output_logger_callback_t userFunc); bool logDeregisterCallback(output_logger_callback_t userFunc); COutputLogger& operator = (const COutputLogger&); COutputLogger& operator = (COutputLogger&&); static std::array<mrpt::system::ConsoleForegroundColor, NUMBER_OF_VERBOSITY_LEVELS>& logging_levels_to_colors(); static const std::array<const char*, NUMBER_OF_VERBOSITY_LEVELS>& logging_levels_to_names();
Fields
std::mutex params_mtx
Acquire this mutex if changing parameters while the app is running.
double run_for_seconds = 0
If >0, run() will return after this period (in seconds)
bool show_sensor_thread_exceptions = true
If enabled (default), exceptions in sensor threads will be reported to std::cerr.
mrpt::config::CConfigFileMemory params
Populated in initialize().
Can be replaced or manipulated by the user after that and before run() to change the parameters loaded from INI file.
std::mutex results_mtx
Acquire this mutex if reading these output variables while the app is running.
std::string rawlog_filename
The generated .rawlog file.
std::size_t rawlog_saved_objects = 0
Counter of saved objects.
Methods
void initialize(int argc, const char** argv)
Initializes the application from CLI parameters.
Refer to the manpage of rawlog-grabber. Throws on errors.
void run()
Runs with the current parameter set.
Throws on errors.