17 #ifndef _GAZEBO_UTIL_LOGRECORD_HH_ 18 #define _GAZEBO_UTIL_LOGRECORD_HH_ 28 #define GZ_LOG_VERSION "1.0" 57 class LogRecordPrivate;
93 public:
bool Init(
const std::string &_subdir);
107 public:
void Add(
const std::string &_name,
const std::string &_filename,
108 std::function<
bool (std::ostringstream &)> _logCallback);
118 public:
bool Remove(
const std::string &_name);
124 public:
void Notify();
130 public:
void SetPaused(
const bool _paused);
135 public:
bool Paused()
const;
139 public:
double Period()
const;
143 public:
void SetPeriod(
const double _period);
147 public: std::string Filter()
const;
151 public:
void SetFilter(
const std::string &_filter);
156 public:
bool RecordResources()
const;
160 public:
void SetRecordResources(
const bool _record);
165 public:
bool IsReadyToStart()
const;
169 public:
bool Running()
const;
178 public:
bool Start(
const std::string &_encoding=
"zlib",
179 const std::string &_path=
"");
184 public:
const std::string &Encoding()
const;
189 public: std::string Filename(
const std::string &_name =
"")
const;
194 public:
unsigned int FileSize(
const std::string &_name =
"")
const;
198 public:
void SetBasePath(
const std::string &_path);
202 public: std::string BasePath()
const;
213 public:
bool FirstUpdate()
const;
217 public:
bool SaveModels(
const std::set<std::string> &models);
222 public:
bool SaveFiles(
const std::set<std::string> &resources);
226 public:
void Write(
const bool _force =
false);
230 public:
unsigned int BufferSize()
const;
236 private:
void Update();
239 private:
void RunUpdate();
242 private:
void RunWrite();
245 private:
void ClearLogs();
248 private:
void PublishLogStatus();
252 private:
void OnLogControl(ConstLogControlPtr &_data);
257 private:
void Cleanup();
260 private:
void OnPause(
const bool _pause);
267 private: std::unique_ptr<LogRecordPrivate> dataPtr;
Forward declarations for the common classes.
Definition: Animation.hh:26
double period
Recording period.
Definition: LogRecord.hh:46
bool recordResources
Recording resources.
Definition: LogRecord.hh:53
Singleton template class.
Definition: SingletonT.hh:33
std::string encoding
The type of encoding (txt, zlib, or bz2).
Definition: LogRecord.hh:39
addtogroup gazebo_util
Definition: LogRecord.hh:79
Log recording parameters.
Definition: LogRecord.hh:36
std::string filter
Log filter string.
Definition: LogRecord.hh:49
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:42
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:44