EventLogger Class
A static class to control event-based SDK logging. Turning on logging while running your Speech SDK scenario provides detailed information from the SDK's core native components. If you report an issue to Microsoft, you may be asked to provide logs to help Microsoft diagnose the issue. Your application should not take dependency on particular log strings, as they may change from one SDK release to another without notice. Use EventLogger when you want to get access to new log strings as soon as they are available, and you need to further process them. For example, integrating Speech SDK logs with your existing logging collection system. Added in version 1.43.0
Event logging is a process wide construct. That means that if (for example) you have multiple speech recognizer objects running in parallel, you can only register one callback function to receive interleaved logs from all recognizers. You cannot register a separate callback for each recognizer.
Constructor
EventLogger()
Methods
set_callback |
Sets event message logging handler. |
set_filters |
Sets filters for logging event messages. Once filters are set, event logger will only be updated with log strings containing at least one of the strings specified by the filters. The match is case sensitive. |
set_level |
Sets the level of the messages to be captured by the logger. |
set_callback
Sets event message logging handler.
static set_callback(handler: Callable[[str], None] = None)
Parameters
Name | Description |
---|---|
callback
Required
|
Event message handler. None to remove the handler from the logger. |
handler
|
Default value: None
|
set_filters
Sets filters for logging event messages. Once filters are set, event logger will only be updated with log strings containing at least one of the strings specified by the filters. The match is case sensitive.
static set_filters(filters: List[str] = [])
Parameters
Name | Description |
---|---|
filters
|
Filters to use, or an empty list to remove previously set filters. Default value: []
|
set_level
Sets the level of the messages to be captured by the logger.
static set_level(level: LogLevel = LogLevel.Info)
Parameters
Name | Description |
---|---|
level
|
Maximum level of detail to be captured by the logger. Default value: LogLevel.Info
|