-
Notifications
You must be signed in to change notification settings - Fork 40
feat: Migrate logger to js-toolkit logger implementation #1959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
# Conflicts: # packages/client/package.json # sample-apps/react-native/dogfood/src/components/BottomControlsDrawer.tsx # yarn.lock
- update logger version
- remove default string
- update @stream-io/loggers package
- update @stream-io/loggers package - add @stream-io/loggers as seperate package in react-native-sdk and
- update old imports
- revert level usage
logger: Logger, | ||
level: LogLevel, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be good to add a function description which mentions that these two arguments set the default scope and that providing a different value in the config (third argument) might override these two, let's also deprecate the signature in favor of using the one coming from the package.
setLogger( | ||
rootLogger, | ||
clientOptions?.logLevel || 'warn', | ||
clientOptions?.logOptions, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably use the new signature here since it's our code.
console.warn( | ||
'[filters] Filter encountered an error and will be disabled', | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we sinking logs to console here? 🤔
- set deprecated on setLogger level and use the new configuration
💡 Overview
Migrated usage of
getLogger
to new syntax where the first tag is considered as scope and the subsequent are tags.Introduced new configuration option:
logOptions?: ConfigureLoggersOptions<string>
which allows the consumers to configure the loggers per scopeMarked
logger
andlogLevel
as deprecated and in first implementation setting them as defaultlevel
andlevel
inconfigureLoggers
📝 Implementation notes
📑 Docs: https://github.com/GetStream/docs-content/pull/