Skip to content

Commit 79cd367

Browse files
Merge pull request #894 from splitio/development
Release v11.7.0
2 parents cdce90f + 3a5f390 commit 79cd367

File tree

6 files changed

+44
-23
lines changed

6 files changed

+44
-23
lines changed

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
11.7.0 (October 7, 2025)
2+
- Added support for custom loggers: added `logger` configuration option and `factory.Logger.setLogger` method to allow the SDK to use a custom logger.
3+
- Updated @splitsoftware/splitio-commons package to version 2.7.0.
4+
15
11.6.0 (September 18, 2025)
26
- 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`.
37
- Updated @splitsoftware/splitio-commons package to version 2.6.0.

package-lock.json

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@splitsoftware/splitio",
3-
"version": "11.6.0",
3+
"version": "11.7.0",
44
"description": "Split SDK",
55
"files": [
66
"README.md",
@@ -38,7 +38,7 @@
3838
"node": ">=14.0.0"
3939
},
4040
"dependencies": {
41-
"@splitsoftware/splitio-commons": "2.6.0",
41+
"@splitsoftware/splitio-commons": "2.7.0",
4242
"bloom-filters": "^3.0.4",
4343
"ioredis": "^4.28.0",
4444
"js-yaml": "^3.13.1",

src/__tests__/offline/node.spec.js

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,16 @@ tape('Node.js Offline Mode', function (t) {
7070
t.test('Trying to specify an invalid extension it will timeout', assert => {
7171
const config = settingsGenerator('.forbidden');
7272

73-
sinon.spy(console, 'log');
74-
75-
const factory = SplitFactory({ ...config, debug: 'ERROR' }); // enable error level logs to check the message.
73+
sinon.stub(console, 'error');
74+
sinon.stub(console, 'warn');
75+
sinon.stub(console, 'info');
76+
sinon.stub(console, 'debug');
77+
78+
const factory = SplitFactory({
79+
...config,
80+
debug: 'ERROR', // enable logs to check the message. If logger is provided, any log level different than 'NONE' will be overridden to 'DEBUG'.
81+
logger: console // use console as custom logger.
82+
});
7683
const client = factory.client();
7784

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

87-
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}`));
94+
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}`));
95+
assert.notOk(console.warn.called, 'warn should not be called');
96+
assert.ok(console.info.called, 'info should be called');
97+
assert.ok(console.debug.called, 'debug should be called');
8898

89-
console.log.restore();
99+
console.error.restore();
100+
console.warn.restore();
101+
console.info.restore();
102+
console.debug.restore();
90103
client.destroy();
91104
assert.end();
92105
});

src/settings/defaults/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const packageVersion = '11.6.0';
1+
export const packageVersion = '11.7.0';

ts-tests/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ let asyncManager: SplitIO.IAsyncManager;
4949
let browserClient: SplitIO.IBrowserClient;
5050
// Utility interfaces
5151
let impressionListener: SplitIO.IImpressionListener;
52+
let MyLogger: SplitIO.Logger = console;
5253

5354
/**** Custom Types ****/
5455

@@ -227,6 +228,7 @@ SDK.Logger.setLogLevel(SDK.Logger.LogLevel.WARN);
227228
SDK.Logger.setLogLevel(SDK.Logger.LogLevel.ERROR);
228229
SDK.Logger.setLogLevel(SDK.Logger.LogLevel.NONE);
229230
SDK.Logger.disable();
231+
SDK.Logger.setLogger(MyLogger);
230232

231233
AsyncSDK.Logger.enable();
232234
AsyncSDK.Logger.setLogLevel(AsyncSDK.Logger.LogLevel.DEBUG);
@@ -235,6 +237,7 @@ AsyncSDK.Logger.setLogLevel(AsyncSDK.Logger.LogLevel.WARN);
235237
AsyncSDK.Logger.setLogLevel(AsyncSDK.Logger.LogLevel.ERROR);
236238
AsyncSDK.Logger.setLogLevel(AsyncSDK.Logger.LogLevel.NONE);
237239
AsyncSDK.Logger.disable();
240+
AsyncSDK.Logger.setLogger(MyLogger);
238241

239242
/**** Tests for IClient interface ****/
240243

@@ -571,6 +574,7 @@ let fullBrowserSettings: SplitIO.IBrowserSettings = {
571574
},
572575
impressionListener: impressionListener,
573576
debug: true,
577+
logger: MyLogger,
574578
streamingEnabled: true,
575579
sync: {
576580
splitFilters: splitFilters,

0 commit comments

Comments
 (0)