A log context that can have multiple log sources and LogResultListener.
More...
|
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...
|
|
|
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.
|
|
A log context that can have multiple log sources and LogResultListener.
◆ CreateLog()
ILog OpenTap.Diagnostic.ILogContext.CreateLog |
( |
string |
Source | ) |
|
Creates a log source with a given source identifier.
- Parameters
-
Source | The 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
-
TimeoutMS | Max 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
-
Timeout | Max 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
-
LogSource | The given log source. |