Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS - Logging Verbose Logs #2563

Open
arslanarso opened this issue Aug 27, 2024 · 4 comments
Open

iOS - Logging Verbose Logs #2563

arslanarso opened this issue Aug 27, 2024 · 4 comments

Comments

@arslanarso
Copy link

arslanarso commented Aug 27, 2024

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

  • Set the WebRTC logging severity to verbose in the iOS code.
  • Observe that verbose logs are not being logged as expected using RCTLogInfo.

Environment details

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

We kindly request your support. Thank you.
@saghul

@arslanarso
Copy link
Author

kindly reminder @saghul 🙏

@saghul
Copy link
Member

saghul commented Aug 28, 2024

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

@arslanarso
Copy link
Author

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
Copy link
Member

saghul commented Aug 29, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants