Allow Logs to be disabled during runtime
- Dominant language
- Python
- Stars
- 44.8k
- Forks
- 4.9k
- Avg merge
- 22h 21m
- Merged PRs (30d)
- 586
Description
### Problem Statement
This is simple, at least from the developer POV: I want to add an option in my app's Settings screen that allow the user to enable/disable full logging behavior. This would require a way to toggle `enableLogs` on/off, but right now that's not possible.
### Solution Brainstorm
The Docs AI even told me to try to write to that property, in the React SDK, via `getOptions().enableLogs`, but that just caused erratic behavior 🤷♂️
Right now, I solved this with a global variable checked in `beforeSendLog`, but running a function over and over again to check a simple boolean seems quite suboptimal, when there are other runtime functions in the SDK — such as changing user details, etc.
I'm not submitting this to the React SDK, even though it's my current target, as I can see this being useful in most platforms.
> Also, it looks like there's not yet a `Product Area: Logs`? 😅
### Product Area
Other
Contributor guide
Research direction
Start with the React SDK's runtime options and the existing enableLogs/getOptions behavior, then compare it with the SDK's runtime user-detail changes. Clarify whether the API must work across platforms and define how enabling and disabling full logging during an active session should be verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100