Skip to content

Commit

Permalink
[FSSDK-9588] export logging types and values
Browse files Browse the repository at this point in the history
  • Loading branch information
raju-opti committed Aug 25, 2023
1 parent 9ff2887 commit c96640d
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/common_exports.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* 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.
*/

export { LogLevel, LogHandler, getLogger, setLogHandler } from './modules/logging';
export { LOG_LEVEL } from './utils/enums';
export { createLogger } from './plugins/logger';
4 changes: 4 additions & 0 deletions lib/index.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { BrowserOdpManager } from './plugins/odp_manager/index.browser';
import Optimizely from './optimizely';
import { IUserAgentParser } from './core/odp/user_agent_parser';
import { getUserAgentParser } from './plugins/odp/user_agent_parser/index.browser';
import * as commonExports from './common_exports';

const logger = getLogger();
logHelper.setLogHandler(loggerPlugin.createLogger());
Expand Down Expand Up @@ -181,7 +182,10 @@ export {
getUserAgentParser,
};

export * from './common_exports';

export default {
...commonExports,
logging: loggerPlugin,
errorHandler: defaultErrorHandler,
eventDispatcher: defaultEventDispatcher,
Expand Down
4 changes: 4 additions & 0 deletions lib/index.lite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { createNotificationCenter } from './core/notification_center';
import { createForwardingEventProcessor } from './plugins/event_processor/forwarding_event_processor';
import { OptimizelyDecideOption, Client, ConfigLite } from './shared_types';
import { createNoOpDatafileManager } from './plugins/datafile_manager/no_op_datafile_manager';
import * as commonExports from './common_exports';

const logger = getLogger();
setLogHandler(loggerPlugin.createLogger());
Expand Down Expand Up @@ -102,7 +103,10 @@ export {
OptimizelyDecideOption,
};

export * from './common_exports';

export default {
...commonExports,
logging: loggerPlugin,
errorHandler: defaultErrorHandler,
eventDispatcher: noOpEventDispatcher,
Expand Down
4 changes: 4 additions & 0 deletions lib/index.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { createEventProcessor } from './plugins/event_processor';
import { OptimizelyDecideOption, Client, Config } from './shared_types';
import { createHttpPollingDatafileManager } from './plugins/datafile_manager/http_polling_datafile_manager';
import { NodeOdpManager } from './plugins/odp_manager/index.node';
import * as commonExports from './common_exports';

const logger = getLogger();
setLogLevel(LogLevel.ERROR);
Expand Down Expand Up @@ -136,7 +137,10 @@ export {
OptimizelyDecideOption,
};

export * from './common_exports';

export default {
...commonExports,
logging: loggerPlugin,
errorHandler: defaultErrorHandler,
eventDispatcher: defaultEventDispatcher,
Expand Down
4 changes: 4 additions & 0 deletions lib/index.react_native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { OptimizelyDecideOption, Client, Config } from './shared_types';
import { createHttpPollingDatafileManager } from
'./plugins/datafile_manager/react_native_http_polling_datafile_manager';
import { BrowserOdpManager } from './plugins/odp_manager/index.browser';
import * as commonExports from './common_exports';

const logger = getLogger();
setLogHandler(loggerPlugin.createLogger());
Expand Down Expand Up @@ -142,7 +143,10 @@ export {
OptimizelyDecideOption,
};

export * from './common_exports';

export default {
...commonExports,
logging: loggerPlugin,
errorHandler: defaultErrorHandler,
eventDispatcher: defaultEventDispatcher,
Expand Down

0 comments on commit c96640d

Please sign in to comment.