Skip to content

Commit

Permalink
Update refs to js-sdk-logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Chu committed Sep 21, 2023
1 parent 3370843 commit c0d88ec
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 18 deletions.
7 changes: 4 additions & 3 deletions src/Provider.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* Copyright 2022, Optimizely
* Copyright 2022-2023, Optimizely
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -15,8 +15,9 @@
*/
import * as React from 'react';
import { UserAttributes } from '@optimizely/optimizely-sdk';
import { getLogger } from '@optimizely/js-sdk-logging';
import { getLogger } from '@optimizely/optimizely-sdk';

// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { OptimizelyContextProvider } from './Context';
import { ReactSDKClient } from './client';
import { areUsersEqual, UserInfo } from './utils';
Expand Down
7 changes: 3 additions & 4 deletions src/autoUpdate.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* Copyright 2020, Optimizely
* Copyright 2020, 2023 Optimizely
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -14,9 +14,8 @@
* limitations under the License.
*/
import { enums } from '@optimizely/optimizely-sdk';
import { LoggerFacade } from '@optimizely/js-sdk-logging';

import { ReactSDKClient } from './client';
import { LoggerFacade } from '@optimizely/optimizely-sdk/dist/modules/logging';

interface AutoUpdate {
(
Expand Down
7 changes: 3 additions & 4 deletions src/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2018-2019, 2022, Optimizely
* Copyright 2018-2019, 2022-2023, Optimizely
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,10 +14,9 @@
* limitations under the License.
*/
import { useCallback, useContext, useEffect, useState, useRef } from 'react';

import { UserAttributes, OptimizelyDecideOption } from '@optimizely/optimizely-sdk';
import { getLogger, LoggerFacade } from '@optimizely/js-sdk-logging';

import { getLogger } from '@optimizely/optimizely-sdk';
import { LoggerFacade } from '@optimizely/optimizely-sdk/dist/modules/logging';
import { setupAutoUpdateListeners } from './autoUpdate';
import { ReactSDKClient, VariableValuesObject, OnReadyResult } from './client';
import { notifier } from './notifier';
Expand Down
22 changes: 19 additions & 3 deletions src/logOnlyEventDispatcher.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
jest.mock('@optimizely/js-sdk-logging', () => ({
/**
* Copyright 2023, Optimizely
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

jest.mock('@optimizely/optimizely-sdk', () => ({
getLogger: jest.fn().mockReturnValue({ debug: jest.fn() }),
}));

import logOnlyEventDispatcher from './logOnlyEventDispatcher';
import * as logging from '@optimizely/js-sdk-logging';
import { getLogger } from '@optimizely/optimizely-sdk';

const logger = logging.getLogger('ReactSDK');
const logger = getLogger('ReactSDK');

describe('logOnlyEventDispatcher', () => {
it('logs a message', () => {
Expand Down
8 changes: 4 additions & 4 deletions src/logOnlyEventDispatcher.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* Copyright 2019, Optimizely
* Copyright 2019, 2023 Optimizely
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -15,9 +15,9 @@
*/

import * as optimizely from '@optimizely/optimizely-sdk';
import * as logging from '@optimizely/js-sdk-logging';
import { getLogger } from '@optimizely/optimizely-sdk';

const logger = logging.getLogger('ReactSDK');
const logger = getLogger('ReactSDK');

/**
* logOnlyEventDispatcher only logs a message at the debug level, and does not
Expand Down

0 comments on commit c0d88ec

Please sign in to comment.