API Guides > ConceptRT 3.x
FileDataLogger Class Reference

File data logger More...

Detailed Description

File data logger

+ Inheritance diagram for FileDataLogger:

Public Member Methods

 FileDataLogger ()
 Default constructor. More...
 
 FileDataLogger (PCChar8 baseFileName)
 Constructor. More...
 
void SetBaseFileName (PCChar8 value)
 Set the base file name. More...
 
const StringGetBaseFileName () const
 Gets the base file name . More...
 
String GetCurrentFilePath () const
 Gets the logger file path. More...
 
void SetMode (FileDataLoggerMode value)
 Set the logger mode. More...
 
FileDataLoggerMode GetMode () const
 Gets the logger mode. More...
 
- Public Member Methods inherited from BaseDataLogger
const bool & GetIsEnabled () const
 Enable the logging. More...
 
const bool & GetIsEnabled ()
 Enable the logging. More...
 
void SetIsEnabled (const bool &value)
 Enable the logging. More...
 
const bool & GetTimeStamped () const
 Enable the time stamping of the logged text. More...
 
const bool & GetTimeStamped ()
 Enable the time stamping of the logged text. More...
 
void SetTimeStamped (const bool &value)
 Enable the time stamping of the logged text. More...
 
void Write (PCChar8 text)
 Writes a text. More...
 
void WriteLine (PCChar8 text="")
 Writes a text and a new line. More...
 
void Write (ISerializable &data)
 Writes the data of an ISerializable object. More...
 
void WriteLine (ISerializable &data)
 Writes the data of an ISerializable object and a new line. More...
 
void Write (PCChar8 text, ISerializable &data)
 Writes the data of an ISerializable object. More...
 
void WriteLine (PCChar8 text, ISerializable &data)
 Writes the data of an ISerializable object and a new line. More...
 

Protected Member Functions

void PerformWrite (PCChar8 text, ISerializable *data, bool newLine, bool timeStamp)
 Perform to write the logged message. More...
 
- Protected Member Functions inherited from BaseDataLogger
void LockedPerformWrite (PCChar8 text, ISerializable *data, bool newLine, bool timeStamp)
 Perform to write the logged message in a locked context. More...
 

Additional Inherited Members

- Protected Attributes inherited from BaseDataLogger
CriticalSection _criticalSection
 _criticalSection used to synchronize the writter with inner traitement mechanisms when needed. More...
 

Constructor & Destructor Documentation

Default constructor.

Warning
SetBaseFileName() must be called before writing any text in order to give a name to the logger file.
FileDataLogger ( PCChar8  baseFileName)

Constructor.

Parameters
baseFileNameBase file name. Extension does't matter. The base name may be extended depending on the FileDataLoggerMode.

Methods Documentation

const String& GetBaseFileName ( ) const

Gets the base file name .

Returns
The base file name.
String GetCurrentFilePath ( ) const

Gets the logger file path.

Returns
The file path.
FileDataLoggerMode GetMode ( ) const

Gets the logger mode.

Returns
The logger mode.
void PerformWrite ( PCChar8  text,
ISerializable data,
bool  newLine,
bool  timeStamp 
)
protectedvirtual

Perform to write the logged message.

Parameters
textA text written before the data. (Can be NULL)
datathe data. (Can be NULL)
newLineWrite a new line at the end.
timeStampWrite a time stamp at the beginning

This method implement the writing mechanism to the destination.

RT Exceptions:

RT_ERROR_LOG_NOT_ABLE_OPEN_FILE

RT_ERROR_INTERNAL_BAD_ENUM_VALUE

Implements BaseDataLogger.

void SetBaseFileName ( PCChar8  value)

Set the base file name.

Parameters
valueThe base file name

Extension does't matter. The base name may be extended depending on the FileDataLoggerMode.

void SetMode ( FileDataLoggerMode  value)

Set the logger mode.

Parameters
valueThe base file name.

Default is FileDataLoggerModeDisabled.

RT Exceptions:
RT_ERROR_INTERNAL_BAD_ENUM_VALUE