jitsi / lib-jitsi-meet

A low-level JS video API that allows adding a completely custom video experience to web apps.
Apache License 2.0
1.34k stars 1.11k forks source link

iOS - Logging Verbose Logs #2563

Open arslanarso opened 3 months ago

arslanarso commented 3 months ago

Description

On the iOS side, we want to log verbose logs using a logger like RCTLogInfo and send these verbose logs to the client side (React Native to iOS project), but we haven't found a solution to log them and send them to the client.

Current behavior

Currently, when setting the logging severity to verbose, the severity is set correctly, but the verbose logs are not logged using RCTLogInfo or similar.

File: /ios/sdk/src/JitsiMeetView.m Code snippet:

- (void)setWebRTCLoggingSeverity:(WebRTCLoggingSeverity)loggingSeverity {
    RCTLogInfo(@"WebRTC logging severity set to %ld", (long)loggingSeverity);
    RTCLoggingSeverity severity;

    switch (loggingSeverity) {
        case LS_VERBOSE:
            severity = RTCLoggingSeverityVerbose;
            break;
        case LS_INFO:
            severity = RTCLoggingSeverityInfo;
            break;
        case LS_WARNING:
            severity = RTCLoggingSeverityWarning;
            break;
        case LS_NONE:
            severity = RTCLoggingSeverityNone;
            break;
        default:
            severity = RTCLoggingSeverityError;
            break;
    }

    WebRTCModuleOptions *options = [WebRTCModuleOptions sharedInstance];
    options.loggingSeverity = severity;
}

Expected Behavior

Verbose logs should be logged just like in the line RCTLogInfo(@"WebRTC logging severity set to %ld", (long)loggingSeverity);.

Possible Solution

Implement a mechanism to log verbose logs using RCTLogInfo or an equivalent logger when the logging severity is set to verbose.

Steps to reproduce

Environment details

React Native version: 0.69.11 jitsi version : 8719 - Mobile 23.2

We kindly request your support. Thank you. @saghul

arslanarso commented 2 months ago

kindly reminder @saghul 🙏

saghul commented 2 months ago

When are you calling that? It only has an effect very early, before RN is initialized.

arslanarso commented 2 months ago

In fact, the structure I sent is a working structure on our side. When information about Logging Severity comes from our iOS project, we set the severity level using this function. Our goal is to log the verbose logs and send these logs to the iOS project.

For example, we should capture and log verbose logs like in the line RCTLogInfo(@"WebRTC logging severity set to %ld", (long)loggingSeverity);

saghul commented 2 months ago

Yes, but the WebRTC log level is o my passed to WebRTC itself once, at app startup time. If you call your function after the library is initialized it will have no effect.