17 #ifndef _GAZEBO_UTIL_LOGRECORD_HH_
18 #define _GAZEBO_UTIL_LOGRECORD_HH_
27 #define GZ_LOG_VERSION "1.0"
52 class LogRecordPrivate;
88 public:
bool Init(
const std::string &_subdir);
102 public:
void Add(
const std::string &_name,
const std::string &_filename,
103 std::function<
bool (std::ostringstream &)> _logCallback);
113 public:
bool Remove(
const std::string &_name);
119 public:
void Notify();
125 public:
void SetPaused(
const bool _paused);
130 public:
bool Paused()
const;
134 public:
double Period()
const;
138 public:
void SetPeriod(
const double _period);
142 public: std::string Filter()
const;
146 public:
void SetFilter(
const std::string &_filter);
151 public:
bool IsReadyToStart()
const;
155 public:
bool Running()
const;
164 public:
bool Start(
const std::string &_encoding=
"zlib",
165 const std::string &_path=
"");
170 public:
const std::string &Encoding()
const;
175 public: std::string Filename(
const std::string &_name =
"")
const;
180 public:
unsigned int FileSize(
const std::string &_name =
"")
const;
184 public:
void SetBasePath(
const std::string &_path);
188 public: std::string BasePath()
const;
199 public:
bool FirstUpdate()
const;
203 public:
void Write(
const bool _force =
false);
207 public:
unsigned int BufferSize()
const;
213 private:
void Update();
216 private:
void RunUpdate();
219 private:
void RunWrite();
222 private:
void ClearLogs();
225 private:
void PublishLogStatus();
229 private:
void OnLogControl(ConstLogControlPtr &_data);
234 private:
void Cleanup();
237 private:
void OnPause(
const bool _pause);
244 private: std::unique_ptr<LogRecordPrivate> dataPtr;
double period
Recording period.
Definition: LogRecord.hh:45
Singleton template class.
Definition: SingletonT.hh:33
std::string encoding
The type of encoding (txt, zlib, or bz2).
Definition: LogRecord.hh:38
addtogroup gazebo_util
Definition: LogRecord.hh:74
Log recording parameters.
Definition: LogRecord.hh:35
std::string filter
Log filter string.
Definition: LogRecord.hh:48
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
std::string path
Path in which to store log files.
Definition: LogRecord.hh:41
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:44