In the JsSIP library, since the upgrade to version 3.7.7, we have encountered a problem where the functionality to override the library's logger does not work as expected. This override feature worked fine in previous versions, however in v3.7.7 the same implementation seems to not function correctly.
Attempt to replace the default logger with a custom logger:
if (this.customLogger) {
JsSIP.debug.log = this.customLogger;
}
Minimal example:
var socket = new JsSIP.WebSocketInterface('wss://sip.myhost.com');
var configuration = {
sockets : [ socket ],
uri : 'sip:alice@example.com',
password : 'superpassword'
};
const customJsSipLogger = (...args) => {
console.log(args);
}
JsSIP.debug.log = customJsSipLogger;
var coolPhone = new JsSIP.UA(configuration);
coolPhone.start();
Expected results:
In previous versions of JsSIP, setting JsSIP.debug.log to a custom logger effectively replaced the default logger with the custom logger provided. Therefore, we would expect all logging that JsSIP does to be passed through the custom logger.
Actual results:
Since the update to v3.7.7, the override attempt using JsSIP.debug.log = this.customLogger; no longer results in the logging being passed to the custom logger. The custom logger is simply not being called, and the library continues to use the default logger.
Environment:
This issue occurs on JsSIP version 3.7.7 and later. It was not present in prior versions of the library.
Description:
In the JsSIP library, since the upgrade to version 3.7.7, we have encountered a problem where the functionality to override the library's logger does not work as expected. This override feature worked fine in previous versions, however in v3.7.7 the same implementation seems to not function correctly.
Steps to reproduce:
Here are the steps to reproduce the issue:
Enable JsSIP debug logs:
Create a custom logger:
Attempt to replace the default logger with a custom logger:
Minimal example:
Expected results:
In previous versions of JsSIP, setting
JsSIP.debug.log
to a custom logger effectively replaced the default logger with the custom logger provided. Therefore, we would expect all logging that JsSIP does to be passed through the custom logger.Actual results:
Since the update to v3.7.7, the override attempt using
JsSIP.debug.log = this.customLogger;
no longer results in the logging being passed to the custom logger. The custom logger is simply not being called, and the library continues to use the default logger.Environment:
This issue occurs on JsSIP version 3.7.7 and later. It was not present in prior versions of the library.