17 #ifndef _GAZEBO_UTIL_LOGRECORD_HH_ 18 #define _GAZEBO_UTIL_LOGRECORD_HH_ 28 #define GZ_LOG_VERSION "1.0" 60 class LogRecordPrivate;
96 public:
bool Init(
const std::string &_subdir);
110 public:
void Add(
const std::string &_name,
const std::string &_filename,
111 std::function<
bool (std::ostringstream &)> _logCallback);
121 public:
bool Remove(
const std::string &_name);
127 public:
void Notify();
133 public:
void SetPaused(
const bool _paused);
138 public:
bool Paused()
const;
142 public:
double Period()
const;
146 public:
void SetPeriod(
const double _period);
150 public: std::string Filter()
const;
154 public:
void SetFilter(
const std::string &_filter);
159 public:
bool RecordResources()
const;
163 public:
void SetRecordResources(
const bool _record);
168 public:
bool IsReadyToStart()
const;
172 public:
bool Running()
const;
181 public:
bool Start(
const std::string &_encoding=
"zlib",
182 const std::string &_path=
"");
187 public:
const std::string &Encoding()
const;
192 public: std::string Filename(
const std::string &_name =
"")
const;
197 public:
unsigned int FileSize(
const std::string &_name =
"")
const;
201 public:
void SetBasePath(
const std::string &_path);
205 public: std::string BasePath()
const;
216 public:
bool FirstUpdate()
const;
220 public:
bool SaveModels(
const std::set<std::string> &models);
225 public:
bool SaveFiles(
const std::set<std::string> &resources);
229 public:
void Write(
const bool _force =
false);
233 public:
unsigned int BufferSize()
const;
239 private:
void Update();
242 private:
void RunUpdate();
245 private:
void RunWrite();
248 private:
void ClearLogs();
251 private:
void PublishLogStatus();
255 private:
void OnLogControl(ConstLogControlPtr &_data);
260 private:
void Cleanup();
263 private:
void OnPause(
const bool _pause);
270 private: std::unique_ptr<LogRecordPrivate> dataPtr;
Forward declarations for the common classes.
Definition: Animation.hh:26
double period
Recording period.
Definition: LogRecord.hh:49
bool recordResources
Recording resources.
Definition: LogRecord.hh:56
Singleton template class.
Definition: SingletonT.hh:33
std::string encoding
The type of encoding (txt, zlib, or bz2).
Definition: LogRecord.hh:42
util
Definition: LogRecord.hh:31
addtogroup gazebo_util
Definition: LogRecord.hh:82
Log recording parameters.
Definition: LogRecord.hh:39
std::string filter
Log filter string.
Definition: LogRecord.hh:52
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:45
#define GZ_SINGLETON_DECLARE(visibility, n1, n2, singletonType)
Helper to declare typed SingletonT.
Definition: SingletonT.hh:61
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:47