Add Logging options to IPersistenceConfiguration. #5626
Merged
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.
TL;DR
@azure/msal-node-extensions
Adds support for configuring
LoggerOptions
when creating anIPersistence
usingPersistenceCreator.createPersistence
.Description
All types implementing
IPersistence
in the@azure/msal-node-extensions
package support aLoggerOptions
object as an optional parameter to their staticcreate
methods.PersistenceCreator.createPersistence
, the factory method creating instances of these types, has currently no way of passing such aLoggerOptions
object in to thesecreate
methods.In cases when a custom logger callback is used in MSAL, it is desirable that logging is done consistently across all components being used in MSAL. This PR adds a way for users to customize the logger, allowing for a consistent logging experience.
Implementation
Add a new optional property
loggerOptions
to theIPersistenceConfiguration
interface type. InsidePersistenceCreator.createPersistence
this property is simply passed along to allcreate
methods that are called within the factory.Breaking changes
None. The added property in
IPersistenceConfiguration
is the only noticeable change to the API surface. If that property is leftundefined
the previous behavior still applies.