Bearbeiten

Freigeben über


Event Callback

The event callback represents the callback object used in CdmCorpusDefinition.SetEventCallback(...) and allows host application to register itself for the purpose of receiving messages issued by the SDK during its operation. Following snippet demonstrates its use:

corpus.SetEventCallback(new EventCallback
    {
        Invoke = (CdmStatusLevel statusLevel, string message) =>
            {
                Console.WriteLine($"{statusLevel}: {message}");
                // ... or send the log to your own logging component
            }
    },
    CdmStatusLevel.Warning);

Note that the event callback will receive all messages of specified level and above that the SDK generates across all API calls, which may make it difficult to understand what happens in one single API call. If you are interested in analyzing or reacting to events generated by a single API call, you may use EventList object in the corpus context.

public class EventCallback

Properties

Name Type Description
Invoke

apply(...) in Java.
Action<CdmStatusLevel, string> Accepts a log message with the status level.