Skip to content
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

basicLogger set to level: 'none' does not disable console logs #286

Open
wlannistamps opened this issue Jun 10, 2024 · 1 comment
Open

Comments

@wlannistamps
Copy link

Describe the bug
Setting the basicLogger to level: 'none' does not disable console logs in React Web using either launchdarkly-react-client-sdk OR launchdarkly-js-client-sdk (per the documentation here: https://docs.launchdarkly.com/sdk/features/logging#react-web)

To reproduce

  1. import basicLogger into react using the launchdarkly-js-client-sdk (or the react version)
    import { basicLogger } from 'launchdarkly-js-client-sdk';
  2. Set the options object with a logger property logger: basicLogger({level: 'none'})
const LDProvider = await asyncWithLDProvider({
	clientSideID: setup.launchDarklySdkKey,
	context: {
		'kind': 'user',
		'key': session.visitorId
	},
	options: {
		logger: basicLogger({level: 'none'})
	},
	reactOptions: {},
});
  1. Refresh the app after compilation is complete

Expected behavior
LaunchDarkly console logs should not appear

SDK version
3.2.0

Language version, developer tools
Node 17.3.1, webpack 5.66.0

OS/platform
Windows 10, Chrome 125

Additional context

@davevanhoorn
Copy link

I'm experiencing the same issue. We're using both the @launchdarkly/node-server-sdk and launchdarkly-js-client-sdk packages, for the node package this does seem to work:

logger: basicLogger({
  level: 'none',
}),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants