[FSSDK-12298] logger adjustment#325
Merged
junaed-optimizely merged 7 commits intomasterfrom Apr 8, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Introduces a React-specific logger wrapper around the JS SDK’s opaque logger config, and wires it into the React SDK surface area.
Changes:
- Added
src/logger/*withcreateLogger()(wraps JS SDK) and aReactLoggerwith level filtering + handler support. - Updated
OptimizelyProviderto use the new React logger accessor instead of an inline console logger. - Updated Vitest config and public exports so logger tests run and
createLoggeris exported from the React SDK entrypoint.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.mts | Includes new logger unit tests and adds logger paths to coverage. |
| src/provider/OptimizelyProvider.tsx | Switches provider error logging to getReactLogger(). |
| src/logger/ReactLogger.ts | Implements React logger abstraction with default console handler and level filtering. |
| src/logger/createLogger.ts | Wraps JS SDK createLogger, resolves levels, stores a React logger singleton. |
| src/logger/index.ts | Re-exports logger APIs/types from the new logger module. |
| src/logger/createLogger.spec.ts | Adds Vitest unit tests for logger behavior. |
| src/index.ts | Exposes createLogger from the new React logger module at the package root. |
| src/client/index.ts | Stops re-exporting JS SDK createLogger from the client submodule. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
raju-opti
requested changes
Apr 7, 2026
raju-opti
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[OPTIMIZELY - REACT] - LEVELprefix format, consistent with the JS SDK's[OPTIMIZELY] - LEVELstylecreateLoggerwraps the JS SDK'screateLogger, attaches aReactLoggeronto theOpaqueLoggervia a private symbol, and returns the sameOpaqueLogger- no public API surface change.createInstanceextracts theReactLoggerfrom the symbol (and deletes it) before passing the cleanOpaqueLoggerto the JS SDK, storing theReactLoggerinReactClientMetafor use by hooks/providersTest plan
Added 13 unit tests covering level resolution, level filtering, custom log handlers etc.
Issues