ADTF  3.18.2
cTestLogger

Utility class to record all log messages in an ADTF system during tests. More...

Classes

struct  tMessage
 A log message. More...
 
struct  tMessages
 Utility class that allows filtering of and searching for messages. More...
 

Public Member Functions

 cTestLogger ()
 Constructor. More...
 
 ~cTestLogger ()
 Destructor.
 
tMessages GetCurrentMessages (bool bClear=true)
 Returns all messages currently received. More...
 
bool WaitForMessage (base::flash::tNanoSeconds tmTimeout=base::flash::tNanoSeconds{-1})
 This blocks the calling context until either a message was received or the given timeout expired. More...
 

Private Attributes

std::unique_ptr< cImplementation > m_pImplementation
 

Detailed Description

Utility class to record all log messages in an ADTF system during tests.

Definition at line 27 of file test_logger.h.

Constructor & Destructor Documentation

◆ cTestLogger()

Constructor.

This registers this logger at the logging service.

Member Function Documentation

◆ GetCurrentMessages()

tMessages GetCurrentMessages ( bool  bClear = true)

Returns all messages currently received.

Parameters
[in]bClearThe internal message buffer is cleared.
Returns
The set of log messages.

◆ WaitForMessage()

bool WaitForMessage ( base::flash::tNanoSeconds  tmTimeout = base::flash::tNanoSeconds{-1})

This blocks the calling context until either a message was received or the given timeout expired.

Parameters
[in]tmTimeoutThe timeout, -1 => wait indefinitely.
Returns
true if a message is available, false if the timeout expired.