Public Member Functions | Public Attributes | List of all members
gazebo::util::LogRecordPrivate::Log Class Reference

Log helper class. More...

#include <LogRecordPrivate.hh>

Public Member Functions

 Log (LogRecord *_parent, const std::string &_relativeFilename, std::function< bool(std::ostringstream &)> _logCB)
 Constructor. More...
 
virtual ~Log ()
 Destructor. More...
 
unsigned int BufferSize ()
 Get the byte size of the buffer. More...
 
void ClearBuffer ()
 Clear the data buffer. More...
 
std::string CompleteFilename () const
 Get the complete filename. More...
 
std::string RelativeFilename () const
 Get the relative filename. More...
 
void Start (const boost::filesystem::path &_path)
 Start the log. More...
 
void Stop ()
 Stop logging. More...
 
unsigned int Update ()
 Update the data buffer. More...
 
void Write ()
 Write data to disk. More...
 

Public Attributes

std::string buffer
 Data buffer. More...
 
boost::filesystem::path completePath
 Complete file path. More...
 
std::function< bool(std::ostringstream &)> logCB
 Callback from which to get data. More...
 
std::ofstream logFile
 The log file. More...
 
LogRecordparent
 Pointer to the log record parent. More...
 
std::string relativeFilename
 Relative log filename. More...
 

Detailed Description

Log helper class.

Constructor & Destructor Documentation

gazebo::util::LogRecordPrivate::Log::Log ( LogRecord _parent,
const std::string &  _relativeFilename,
std::function< bool(std::ostringstream &)>  _logCB 
)

Constructor.

Parameters
[in]_parentPointer to the LogRecord parent.
[in]_relativeFilenameThe name of the log file to generate, sans the complete path.
[in]_logCBCallback function, which is used to get log data.
virtual gazebo::util::LogRecordPrivate::Log::~Log ( )
virtual

Destructor.

Member Function Documentation

unsigned int gazebo::util::LogRecordPrivate::Log::BufferSize ( )

Get the byte size of the buffer.

Returns
Buffer byte size.
void gazebo::util::LogRecordPrivate::Log::ClearBuffer ( )

Clear the data buffer.

std::string gazebo::util::LogRecordPrivate::Log::CompleteFilename ( ) const

Get the complete filename.

Returns
The complete filename.
std::string gazebo::util::LogRecordPrivate::Log::RelativeFilename ( ) const

Get the relative filename.

This is the filename passed to the constructor.

Returns
The relative filename.
void gazebo::util::LogRecordPrivate::Log::Start ( const boost::filesystem::path &  _path)

Start the log.

Parameters
[in]_pathThe complete path in which to put the log file.
void gazebo::util::LogRecordPrivate::Log::Stop ( )

Stop logging.

unsigned int gazebo::util::LogRecordPrivate::Log::Update ( )

Update the data buffer.

Returns
The size of the data buffer.
void gazebo::util::LogRecordPrivate::Log::Write ( )

Write data to disk.

Member Data Documentation

std::string gazebo::util::LogRecordPrivate::Log::buffer

Data buffer.

boost::filesystem::path gazebo::util::LogRecordPrivate::Log::completePath

Complete file path.

std::function<bool (std::ostringstream &)> gazebo::util::LogRecordPrivate::Log::logCB

Callback from which to get data.

std::ofstream gazebo::util::LogRecordPrivate::Log::logFile

The log file.

LogRecord* gazebo::util::LogRecordPrivate::Log::parent

Pointer to the log record parent.

std::string gazebo::util::LogRecordPrivate::Log::relativeFilename

Relative log filename.


The documentation for this class was generated from the following file: