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. |
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應