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

Node: New setLogEventListeners() utility to get log events #1448

Merged
merged 2 commits into from
Aug 30, 2024

Commits on Aug 29, 2024

  1. Node: New setLogEventListeners() utility to get log events

    ### Details
    
    - Instead of relying on `DEBUG` variable and stdout/stderr logs, an application may want to collect mediasoup generated logs and post them somewhere.
    - This PR exposed a new `setLogEventListeners()` function at mediasoup root module level.
    
    ### Usage example
    
    ```ts
    mediasoup.setLogEventListeners({
      ondebug: undefined,
      onwarn: (namespace: string, log: string) => {
        MyEnterpriseLogger.warn(`${namespace} ${log}`);
      },
      onerror: (namespace: string, log: string, error?: Error) => {
        if (error) {
          MyEnterpriseLogger.error(`${namespace} ${log}: ${error}`);
        } else {
          MyEnterpriseLogger.error(`${namespace} ${log}`);
        }
      }
    });
    ```
    ibc committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    295d5ad View commit details
    Browse the repository at this point in the history
  2. update CHANGELOG

    ibc committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    b1d51a1 View commit details
    Browse the repository at this point in the history