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

Add a way to filter debug logging based on a given debugLevel in posthog-react-native #113

Open
4 tasks
statico opened this issue Oct 3, 2023 · 2 comments
Open
4 tasks
Labels
Configuration enhancement New feature or request help wanted Extra attention is needed react-native

Comments

@statico
Copy link

statico commented Oct 3, 2023

Is your feature request related to a problem?

When using <PostHogProvider apiKey={...} debug={__DEV__}>, PostHog produces absurd amounts of logging with "PostHog Debug" messages, especially if you have heavy instrumentation. This is very distracting and can hide more important log messages.

Describe the solution you'd like

Add an option to PostHogProvider like quiet or loggingEnabled={false} that can be used to disable the logging.

Describe alternatives you've considered

  • Writing really gross JSX workarounds
  • Patching the package with patch-package (currently doing this)

Related sub-libraries

  • All of them
  • posthog-web
  • posthog-node
  • posthog-react-native

Additional context

<3

@marandaneto
Copy link
Member

I think the solution here would be to implement a debugLevel so you can define eg debug, error, fatal levels, and this filter out the console logs.

@marandaneto
Copy link
Member

Btw you can still do posthog.debug(false) at runtime, or just don't use debug={__DEV__} since it's disabled by default anyway.
The loggingEnabled suggestion is pretty much what's already available.

@marandaneto marandaneto changed the title Add a way to disable debug logging in posthog-react-native Add a way to filter debug logging based on a given debugLevel in posthog-react-native Feb 20, 2024
@marandaneto marandaneto added the help wanted Extra attention is needed label Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Configuration enhancement New feature or request help wanted Extra attention is needed react-native
Projects
None yet
Development

No branches or pull requests

2 participants