Function: setLogger

Function: setLogger()

setLogger(logLevel): Promise< void >

Description

Set logger.

Fordefi does not print logs to the console.
If the application (client) wants to receive logs, it must call the setLogger
with the desired log level. The callback with LogEvent will be received as a
callback in NativeEventEmitter registered listener with tag LogEvent:

Example

const eventEmitter = Platform.OS === 'ios' ? new NativeEventEmitter(NativeModules.FordefiSdk) :
new NativeEventEmitter(NativeModules.FordefiSdkModule);

eventEmitter.addListener('LogEvent', event => { console.log(${event.logLevel}: ${event.logMessage}); });

For more information, see Add logging.

Throws

FordefiSdkErrorResult

Parameters

ParameterTypeDescription
logLevelstringLog level.

Returns

Promise< void >

A Promise that returns a secret when the operation is successful.