OpenTAP 9.25
API Reference
Public Member Functions | Properties | List of all members
OpenTap.Diagnostic.ILogContext Interface Reference

A log context that can have multiple log sources and LogResultListener. More...

Inheritance diagram for OpenTap.Diagnostic.ILogContext:
OpenTap.Diagnostic.ILogContext2

Public Member Functions

ILog CreateLog (string Source)
 Creates a log source with a given source identifier. More...
 
void RemoveLog (ILog LogSource)
 Removes a log source from the context. More...
 
void AttachListener (ILogListener Listener)
 Attaches a log listener.
 
void DetachListener (ILogListener Listener)
 Detaches a log listener. Automatically flushes the context.
 
bool Flush (int TimeoutMS=0)
 Flush all events received at the time instant this method is called, but only waits a number of milliseconds. More...
 
bool Flush (TimeSpan Timeout)
 Flush all events received at the time instant this method is called, but only waits a given duration. More...
 

Properties

ILogTimestampProvider Timestamper [getset]
 Timestamp method to use for all subsequent logged events.
 
bool Async [getset]
 When true, sets the log context to an asynchronous mode (avoiding the potential synchronous mode problem of log sources returning from ILog.LogEvent(int, string) calls before the events have been processed). When false, log sources always wait until all log listeners have processed the events.

 
int MessageBufferSize [getset]
 Maximum number of outstanding events. Only relevant for Async mode.

 

Detailed Description

A log context that can have multiple log sources and LogResultListener.

Member Function Documentation

◆ CreateLog()

ILog OpenTap.Diagnostic.ILogContext.CreateLog ( string  Source)

Creates a log source with a given source identifier.

Parameters
SourceThe source identifier of this log source.

◆ Flush() [1/2]

bool OpenTap.Diagnostic.ILogContext.Flush ( int  TimeoutMS = 0)

Flush all events received at the time instant this method is called, but only waits a number of milliseconds.

Parameters
TimeoutMSMax time to wait for messages. If 0 it will wait infinitely.
Returns
True if it waited successfully, or false if a timeout occurred.

◆ Flush() [2/2]

bool OpenTap.Diagnostic.ILogContext.Flush ( TimeSpan  Timeout)

Flush all events received at the time instant this method is called, but only waits a given duration.

Parameters
TimeoutMax time to wait for messages, or zero to wait infinitely.
Returns
True if it waited successfully, or false if a timeout occurred.

◆ RemoveLog()

void OpenTap.Diagnostic.ILogContext.RemoveLog ( ILog  LogSource)

Removes a log source from the context.

Parameters
LogSourceThe given log source.

OpenTAP 9.25 API built Tue Aug 6 2024 07:49:25