Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
11.7.0 (October 7, 2025)
- Added support for custom loggers: added `logger` configuration option and `factory.Logger.setLogger` method to allow the SDK to use a custom logger.
- Updated @splitsoftware/splitio-commons package to version 2.7.0.

11.6.0 (September 18, 2025)
- Added `storage.wrapper` configuration option to allow the SDK to use a custom storage wrapper for the storage type `LOCALSTORAGE`. Default value is `window.localStorage`.
- Updated @splitsoftware/splitio-commons package to version 2.6.0.
Expand Down
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@splitsoftware/splitio",
"version": "11.6.0",
"version": "11.7.0",
"description": "Split SDK",
"files": [
"README.md",
Expand Down Expand Up @@ -38,7 +38,7 @@
"node": ">=14.0.0"
},
"dependencies": {
"@splitsoftware/splitio-commons": "2.6.0",
"@splitsoftware/splitio-commons": "2.7.0",
"bloom-filters": "^3.0.4",
"ioredis": "^4.28.0",
"js-yaml": "^3.13.1",
Expand Down
23 changes: 18 additions & 5 deletions src/__tests__/offline/node.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,16 @@ tape('Node.js Offline Mode', function (t) {
t.test('Trying to specify an invalid extension it will timeout', assert => {
const config = settingsGenerator('.forbidden');

sinon.spy(console, 'log');

const factory = SplitFactory({ ...config, debug: 'ERROR' }); // enable error level logs to check the message.
sinon.stub(console, 'error');
sinon.stub(console, 'warn');
sinon.stub(console, 'info');
sinon.stub(console, 'debug');

const factory = SplitFactory({
...config,
debug: 'ERROR', // enable logs to check the message. If logger is provided, any log level different than 'NONE' will be overridden to 'DEBUG'.
logger: console // use console as custom logger.
});
const client = factory.client();

client.on(client.Event.SDK_READY, () => {
Expand All @@ -84,9 +91,15 @@ tape('Node.js Offline Mode', function (t) {
client.on(client.Event.SDK_READY_TIMED_OUT, () => {
assert.pass('If tried to load a file with invalid extension, we should emit SDK_READY_TIMED_OUT.');

assert.ok(console.log.calledWithMatch(`[ERROR] splitio => sync:offline: There was an issue loading the mock feature flags data. No changes will be applied to the current cache. Error: Invalid extension specified for feature flags mock file. Accepted extensions are ".yml" and ".yaml". Your specified file is ${config.features}`));
assert.ok(console.error.calledWithMatch(`splitio => sync:offline: There was an issue loading the mock feature flags data. No changes will be applied to the current cache. Error: Invalid extension specified for feature flags mock file. Accepted extensions are ".yml" and ".yaml". Your specified file is ${config.features}`));
assert.notOk(console.warn.called, 'warn should not be called');
assert.ok(console.info.called, 'info should be called');
assert.ok(console.debug.called, 'debug should be called');

console.log.restore();
console.error.restore();
console.warn.restore();
console.info.restore();
console.debug.restore();
client.destroy();
assert.end();
});
Expand Down
2 changes: 1 addition & 1 deletion src/settings/defaults/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const packageVersion = '11.6.0';
export const packageVersion = '11.7.0';
4 changes: 4 additions & 0 deletions ts-tests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ let asyncManager: SplitIO.IAsyncManager;
let browserClient: SplitIO.IBrowserClient;
// Utility interfaces
let impressionListener: SplitIO.IImpressionListener;
let MyLogger: SplitIO.Logger = console;

/**** Custom Types ****/

Expand Down Expand Up @@ -227,6 +228,7 @@ SDK.Logger.setLogLevel(SDK.Logger.LogLevel.WARN);
SDK.Logger.setLogLevel(SDK.Logger.LogLevel.ERROR);
SDK.Logger.setLogLevel(SDK.Logger.LogLevel.NONE);
SDK.Logger.disable();
SDK.Logger.setLogger(MyLogger);

AsyncSDK.Logger.enable();
AsyncSDK.Logger.setLogLevel(AsyncSDK.Logger.LogLevel.DEBUG);
Expand All @@ -235,6 +237,7 @@ AsyncSDK.Logger.setLogLevel(AsyncSDK.Logger.LogLevel.WARN);
AsyncSDK.Logger.setLogLevel(AsyncSDK.Logger.LogLevel.ERROR);
AsyncSDK.Logger.setLogLevel(AsyncSDK.Logger.LogLevel.NONE);
AsyncSDK.Logger.disable();
AsyncSDK.Logger.setLogger(MyLogger);

/**** Tests for IClient interface ****/

Expand Down Expand Up @@ -571,6 +574,7 @@ let fullBrowserSettings: SplitIO.IBrowserSettings = {
},
impressionListener: impressionListener,
debug: true,
logger: MyLogger,
streamingEnabled: true,
sync: {
splitFilters: splitFilters,
Expand Down