Get SDK Logs

🧾 REL-ID SDK API Documentation – onSdkLogPrintRequest

📌 Overview

onSdkLogPrintRequest is a callback event triggered by the REL-ID SDK whenever the SDK has log information that needs to be captured or displayed. This is essential for debugging and monitoring SDK behavior in development and QA environments.


🖥️ UI Screen Requirements

No dedicated screen is required for this functionality. However, in debug builds or QA environments, developers may create a debug console/log viewer screen to display SDK logs to assist in troubleshooting.


🔁 API Invocation Flow

This event is triggered internally by the SDK based on the RDNALoggingLevel value passed during SDK initialization. There is no API that needs to be manually invoked to trigger this event.> To receive SDK logs, initialize the SDK with RDNALoggingLevel other than RDNA_NO_LOGS.


🧠 Relevant Platforms – Code Snippets

React Native
let sdkLogPrintSubscription = rdnaEventRegistery.addListener(
  'onSdkLogPrintRequest',
  this.onSdkLogPrintRequest.bind(this)
);

onSdkLogPrintRequest(logMessage) {
  console.log("SDK Log:", logMessage);
  // Optional: forward to external logging service
}
Flutter
rdnaClient.on(RdnaClient.onSdkLogPrintRequest, onSdkLogPrintRequest);

void onSdkLogPrintRequest(String logMessage) {
  print("SDK Log: $logMessage");
  // Optional: save to local file or send to server
}
Cordova
document.addEventListener(
  'onSdkLogPrintRequest',
  this.onSdkLogPrintRequest.bind(this),
  false
);

onSdkLogPrintRequest(logMessage) {
  console.log("SDK Log:", logMessage);
  // Optional: external logging
}
Native Android
@Override
public int onSdkLogPrintRequest(RDNALoggingLevel level, String logData) {
    Log.d("REL-ID SDK", "[" + level.toString() + "] " + logData);
    // Optional: return 0 if handled successfully
    return 0;
}
Native iOS (Objective-C)
- (int)onSdkLogPrintRequest:(RDNALoggingLevel)level andlogData:(NSString *)logData {
    NSLog(@"[REL-ID SDK][%@] %@", level, logData);
    // Optional: return 0 to indicate success
    return 0;
}

📦 Payload Fields

FieldTypeDescription
logMessageStringThe actual log content/message.

Sample logMessage

"REQRESP : 2020-07-10T14:47:27:978417 : Generated Keys
0676491d-37db-4c0d-b649-1d37db6c0ddfpranavUSERDATAFingerPrint ::
D75agma1DP38uR1gfj6R37SUl8Du4cPeN83aiZOOeFw="

🧩 Event Response Handling

  • Capture & display the logs or store it.
  • This event does not require any API response, but it is advised to:

** Show logs in debug UI
** Store logs temporarily for crash reporting tools (e.g., Firebase, Sentry)


📤 Related API Call – SDK Initialization

To enable this event, you must set logging level during initialization:

// React Native example
RdnaClient.initialize(
  agentInfo,
  host,
  port,
  cipherSpec,
  cipherSalt,
  proxySettings,
  sslDetails,
  RDNALoggingLevel.RDNA_DEBUG, // 👈 Enable log printing
  (syncResponse) => {}
);

🧷 Summary

  • onSdkLogPrintRequest is a passive listener for SDK logs.
  • Use it during development and debugging phases.
  • Ensure to set RDNALoggingLevel correctly during initialization. SDK will not trigger onSdkLogPrintRequest if RDNALoggingLevel is set to RDNA_NO_LOGS***