API Guides > ConceptRT 3.x
BaseDataLogger Class Referenceabstract

Base data logger. More...

Detailed Description

Base data logger.

+ Inheritance diagram for BaseDataLogger:

Public Member Methods

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

virtual void PerformWrite (PCChar8 text, ISerializable *data, bool newLine, bool timeStamp)=0
 Perform to write the logged message. More...
 
void LockedPerformWrite (PCChar8 text, ISerializable *data, bool newLine, bool timeStamp)
 Perform to write the logged message in a locked context. More...
 

Protected Attributes

CriticalSection _criticalSection
 _criticalSection used to synchronize the writter with inner traitement mechanisms when needed. More...
 

Private fields

bool IsEnabled
 Enable the logging. More...
 
bool TimeStamped
 Enable the time stamping of the logged text. More...
 

Methods Documentation

const bool & GetIsEnabled ( ) const
inline

Enable the logging.

See also
Field: IsEnabled
Returns
the property value
See also
Setter: SetIsEnabled()
const bool & GetIsEnabled ( )
inline

Enable the logging.

See also
Field: IsEnabled
Returns
the property value
See also
Setter: SetIsEnabled()
const bool & GetTimeStamped ( ) const
inline

Enable the time stamping of the logged text.

See also
Field: TimeStamped
Returns
the property value
See also
Setter: SetTimeStamped()
const bool & GetTimeStamped ( )
inline

Enable the time stamping of the logged text.

See also
Field: TimeStamped
Returns
the property value
See also
Setter: SetTimeStamped()
void LockedPerformWrite ( PCChar8  text,
ISerializable data,
bool  newLine,
bool  timeStamp 
)
protected

Perform to write the logged message in a locked context.

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

Used by all Write methods, this call PerformWrite after having required the _criticalSection

virtual void PerformWrite ( PCChar8  text,
ISerializable data,
bool  newLine,
bool  timeStamp 
)
protectedpure virtual

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.

Implemented in BaseConsole, BaseRealtimeDataLoggerAdapter, BaseDynamicInvocationDataLogger, BaseTeeDataLogger, and FileDataLogger.

void SetIsEnabled ( const bool &  value)
inline

Enable the logging.

Parameters
[in]valueThe new parameter value.
Returns
the property value
See also
Field: IsEnabled
Getter: GetIsEnabled()
void SetTimeStamped ( const bool &  value)
inline

Enable the time stamping of the logged text.

Parameters
[in]valueThe new parameter value.
Returns
the property value
See also
Field: TimeStamped
Getter: GetTimeStamped()
void Write ( PCChar8  text)

Writes a text.

Parameters
textthe text.
void Write ( ISerializable data)

Writes the data of an ISerializable object.

Parameters
datathe data.
Note
Be careful that the ISerializable will be written in a locked context. Huge object serialization may leads to performance issue.
void Write ( PCChar8  text,
ISerializable data 
)

Writes the data of an ISerializable object.

Parameters
textA text written before the data. (Can be NULL)
datathe data.
Note
Be careful that the ISerializable will be written in a locked context. Huge object serialization may leads to performance issue.
void WriteLine ( PCChar8  text = "")

Writes a text and a new line.

Parameters
text(optional) the text. Default = ""
void WriteLine ( ISerializable data)

Writes the data of an ISerializable object and a new line.

Parameters
datathe data.
Note
Be careful that the ISerializable will be written in a locked context. Huge object serialization may leads to performance issue.
void WriteLine ( PCChar8  text,
ISerializable data 
)

Writes the data of an ISerializable object and a new line.

Parameters
textA text written before the data. (Can be NULL)
datathe data.
Note
Be careful that the ISerializable will be written in a locked context. Huge object serialization may leads to performance issue.

Fields Documentation

CriticalSection _criticalSection
protected

_criticalSection used to synchronize the writter with inner traitement mechanisms when needed.

bool IsEnabled
private

Enable the logging.

See also
Getter: GetIsEnabled()
Setter: SetIsEnabled()
bool TimeStamped
private

Enable the time stamping of the logged text.

See also
Getter: GetTimeStamped()
Setter: SetTimeStamped()