launchdarkly / js-client-sdk

LaunchDarkly Client-side SDK for Browser JavaScript
Other
109 stars 62 forks source link

option to disable logger in browser console #293

Closed glebpigulevsky closed 6 months ago

glebpigulevsky commented 8 months ago

Is your feature request related to a problem? Please describe. I wouldn't want to see constant logs in the browser console at all levels regarding launchDarkly's operation

Describe the solution you'd like boolean option in the config to disable logger

Additional context btw, link in the https://github.com/launchdarkly/js-client-sdk/blob/8675ab6b0d1a4833e4e140af3658011bf48b2162/README.md#:~:text=See%20LDOptions.logger doesnt work

kinyoklion commented 8 months ago

Hello @glebpigulevsky,

Logging can be disabled using the basicLogger, or by writing a custom logger. We won't be adding another configuration to disable it independently of these capabilities.

Example code disabling logging:

      const ldclient = LDClient.initialize(clientSideID, context, {
        logger: LDClient.basicLogger({ level: 'none' })
      });

Thank you for the PR to fix the links to documentation.

Thank you, Ryan