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

Provide a way to turn off Insights logging #310

Open
mariuscristescuascend opened this issue Mar 15, 2024 · 0 comments
Open

Provide a way to turn off Insights logging #310

mariuscristescuascend opened this issue Mar 15, 2024 · 0 comments

Comments

@mariuscristescuascend
Copy link

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

I recently integrated the InstantSearch SDK v7.26.1 and AlgoliaSearchClient SDK v8.19.0 in our iOS app in order to trigger several InstantSearch Insights events.

After I finished my integration debugging I was left with a verbose logging in my console that I cannot turn off. Every 30 seconds I get a log like this:

2024-03-06T14:37:01+0200 info Insights (B5UR3QDMCF) : [InstantSearchInsights] no pending event packages, skip flushing
2024-03-06T14:37:31+0200 info Insights (B5UR3QDMCF) : [InstantSearchInsights] no pending event packages, skip flushing
2024-03-06T14:38:01+0200 info Insights (B5UR3QDMCF) : [InstantSearchInsights] no pending event packages, skip flushing
2024-03-06T14:38:31+0200 info Insights (B5UR3QDMCF) : [InstantSearchInsights] no pending event packages, skip flushing
2024-03-06T14:39:01+0200 info Insights (B5UR3QDMCF) : [InstantSearchInsights] no pending event packages, skip flushing
2024-03-06T14:39:31+0200 info Insights (B5UR3QDMCF) : [InstantSearchInsights] no pending event packages, skip flushing

I instantiate Insights with:

    Insights.register(appId: ApplicationID(rawValue: algoliaAppId),
                     apiKey: APIKey(rawValue: algoliaApiKey),
                     userToken: UserToken(rawValue: String(user.id)))

I tried this, but it had no effect:

   Insights.shared(appId: ApplicationID(rawValue: algoliaAppId))?.isLoggingEnabled = false

This logging past the integration phase is unnecessary and pollutes the console, making it hard to see important logging.

Describe the solution you'd like 🤔*

Provide a way to turn of the logging, or better yet, make logging default to silent and only activate it when needed.

@mariuscristescuascend mariuscristescuascend changed the title Turn off insights logging Provide a way to turn off Insights logging Mar 15, 2024
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

1 participant