Share via


Class SPXEventLogger

Declaration

@class SPXEventLogger : NSObject;

Description

Class with static methods to control callback-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 SPXEventLogger 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.

Class Methods

setCallback:error:

Registers a callback function that will be invoked for each new log message.

+ (void)setCallback:(SPXEventLoggerHandler _Nullable)callback
    error:(NSError * _Nullable * _Nullable)outError

Parameters

  • callback - The callback function to call. Pass nil to stop the Event Logger.
  • outError - The error information.

setCallback:

Registers a callback function that will be invoked for each new log message.

+ (void)setCallback:(SPXEventLoggerHandler _Nullable)callback

Parameters

  • callback - The callback function to call. Pass nil to stop the Event Logger.

setFilters:error:

Sets or clears the filters that apply to file logging.

+ (void)setFilters:(NSArray<NSString *> * _Nullable)filters
    error:(NSError * _Nullable * _Nullable)outError

Parameters

  • filters - Filters to use, or nil or an empty list to remove previously set filters.
  • outError - The error information.

setFilters:

Sets or clears the filters that apply to file logging.

+ (void)setFilters:(NSArray<NSString *> * _Nullable)filters

Parameters

  • filters - Filters to use, or nil or an empty list to remove previously set filters.

setLevel:

Sets the level of the messages to be captured by the logger.

+ (void)setLevel:(SPXLogLevel)level

Parameters

  • level - Maximum level of detail to be captured by the logger.