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 disable logging #77

Closed
choulepoka opened this issue May 23, 2024 · 5 comments
Closed

Add a way to disable logging #77

choulepoka opened this issue May 23, 2024 · 5 comments

Comments

@choulepoka
Copy link

Is your feature request related to a problem? Please describe.

Yes. The logging of the LaunchDarkly iOS Client is verbose. When debugging, it is not uncommon to get hundreds of debugging statement in the console, with no easy to disable them.

Describe the solution you'd like

Create a way to disable logging, and optionally have the LaunchDarkly iOS Client configure it to match. Ideally somethings like:

Logs.logger = .disabled

Describe alternatives you've considered

  • Swizzling the Logs class, but since it is not an objective-c class, it cannot be swizzled
  • Forking the library, and replacing the logging code with noop implementations

Additional context

Not that I can see.

@tanderson-ld
Copy link
Contributor

tanderson-ld commented May 24, 2024

Hi @choulepoka, thank you for bringing this to our attention. If I recall correctly, you are using the LaunchDarkly iOS SDK and not just the event-source. @keelerm84 recently updated the logging implementation in the iOS SDK to use os_log which has better filtering capabilities. Would us bringing this change into the swift-eventsource meet your needs? We will have to investigate to see if that will work well with pure swift consumers of this event-source.

I have logged a story for tracking this: SC-245493

@choulepoka
Copy link
Author

@tanderson-ld If you are using OSLog, we would need an exposeed public setter so that we can set the value of the OSLog to .disabled. That would would probably work if both framework actually expose something like that.

@tanderson-ld
Copy link
Contributor

tanderson-ld commented May 31, 2024

@choulepoka, we have released version swift-eventsource 3.3.0 which supports setting LDEventSource.Config.logger. We are in the process of updating the iOS SDK to pass it's logger in to the event source when it is created so that one logger is used for both. That PR is here. Leaving this issue open since I think you are looking for this change in the iOS SDK and not just in this swift-eventsource repo.

@tanderson-ld
Copy link
Contributor

We're still working to get the iOS SDK update out that includes the fix for the iOS SDK itself.

@tanderson-ld
Copy link
Contributor

This is now resolved in the iOS Client SDK v9.8.1

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