Go to the documentation of this file.
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);
181 public:
bool Start(
const std::string &_encoding=
"zlib",
182 const std::string &_path=
"");
192 public: std::string
Filename(
const std::string &_name =
"")
const;
197 public:
unsigned int FileSize(
const std::string &_name =
"")
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);
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;
const std::string & Encoding() const
Get the encoding used.
bool SaveModels(const std::set< std::string > &models)
Return true if all the models are saved successfully.
void SetPeriod(const double _period)
Set the log recording period.
Forward declarations for the common classes.
Definition: Animation.hh:27
bool Init(const std::string &_subdir)
Initialize logging into a subdirectory.
A Time class, can be used to hold wall- or sim-time. stored as sec and nano-sec.
Definition: Time.hh:48
std::string filter
Log filter string.
Definition: LogRecord.hh:52
Singleton template class.
Definition: SingletonT.hh:34
unsigned int FileSize(const std::string &_name="") const
Get the file size for a log object.
std::string BasePath() const
Get the base path for a log recording.
void Add(const std::string &_name, const std::string &_filename, std::function< bool(std::ostringstream &)> _logCallback)
Add an object to a log file.
util
Definition: LogRecord.hh:31
double period
Recording period.
Definition: LogRecord.hh:49
void Fini()
Finialize, and shutdown.
bool RecordResources() const
Get whether the model meshes and materials are saved when recording.
bool Running() const
Get whether logging is running.
std::string Filename(const std::string &_name="") const
Get the filename for a log object.
void Notify()
Tell the recorder that an update should occur.
bool Remove(const std::string &_name)
Remove an entity from a log.
std::string encoding
The type of encoding (txt, zlib, or bz2).
Definition: LogRecord.hh:42
addtogroup gazebo_util
Definition: LogRecord.hh:83
std::string path
Path in which to store log files.
Definition: LogRecord.hh:45
bool IsReadyToStart() const
Get whether the logger is ready to start, which implies that any previous runs have finished.
Log recording parameters.
Definition: LogRecord.hh:40
double Period() const
Get the log recording period.
bool Start(const LogRecordParams &_params)
Start the logger.
bool FirstUpdate() const
Return true if an Update has not yet been completed.
bool Start(const std::string &_encoding="zlib", const std::string &_path="")
Start the logger.
unsigned int BufferSize() const
Get the size of the buffer.
void SetPaused(const bool _paused)
Set whether logging should pause.
bool Paused() const
Get whether logging is paused.
std::string Filter() const
Get the log recording filter string.
void Stop()
Stop the logger.
common::Time RunTime() const
Get the run time in sim time.
bool recordResources
Recording resources.
Definition: LogRecord.hh:56
void SetFilter(const std::string &_filter)
Set the log recording filter string.
void SetRecordResources(const bool _record)
Set whether to save model meshes and materials when recording.
void Write(const bool _force=false)
Write all logs.
#define GZ_SINGLETON_DECLARE(visibility, n1, n2, singletonType)
Helper to declare typed SingletonT.
Definition: SingletonT.hh:61
gazebo
Definition: LogRecord.hh:31
void SetBasePath(const std::string &_path)
Set the base path.
bool SaveFiles(const std::set< std::string > &resources)
Return true if all the files are saved successfully.