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

Calling setLoggerLevel does nothing #5124

Closed
rgkobashi opened this issue Mar 17, 2020 · 8 comments
Closed

Calling setLoggerLevel does nothing #5124

rgkobashi opened this issue Mar 17, 2020 · 8 comments

Comments

@rgkobashi
Copy link

rgkobashi commented Mar 17, 2020

[REQUIRED] Step 1: Describe your environment

  • Xcode version: 11.3.1
  • Firebase SDK version: 6.18 and 6.20
  • Firebase Component: Analytics
  • Component version: 6.18 and 6.20
  • Installation method: CocoaPods

[REQUIRED] Step 2: Describe the problem

FirebaseConfiguration.shared.setLoggerLevel(.min) has no effect on the logging.
This is same as #3516, I apologize for the duplicate but I couldn't find any solution in other place neither comment on the that ticket.

Steps to reproduce:

  1. After AppDelegate.application(:didFinishLaunchingWithOptions:) is being executed call FirebaseConfiguration.shared.setLoggerLevel(.min) and FirebaseApp.configure().
  2. Run the app attached to the debugger
Expected

Less logs on the console

Actual

Same amount of logs regardless of the param used on setLoggerLevel

Relevant Code:

FirebaseConfiguration.shared.setLoggerLevel(.min)
FirebaseApp.configure()
@google-oss-bot

This comment has been minimized.

@ryanwilson
Copy link
Member

Thanks for the report - I was able to reproduce this. There was a small effect on the logging (3 lines added from Core) when going from .min -> .max but Analytics still logs everything regardless.

I found a few workarounds for the time being:

  • Call setLoggerLevel(.min) after FirebaseApp.configure() quiets the logs significantly
  • Use the instructions logged to disable debug logging: "To disable debug logging set the following application argument: -noFIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)"

Will report internally and update with a bug number shortly.

@ryanwilson
Copy link
Member

Filed internally at b/151716193

@ryanwilson
Copy link
Member

Did you start your project from the quickstart? It looks like the quickstart includes the -FIRAnalyticsDebugEnabled flag by default in the scheme for quickstart applications which could explain the debug logs appearing there.

@rgkobashi
Copy link
Author

thank you very much for your quick response @ryanwilson

I did what you mention (calling setLoggerLevel(.min) after FirebaseApp.configure()) and the logs are still the same.

Did you start your project from the quickstart? It looks like the quickstart includes the -FIRAnalyticsDebugEnabled flag by default in the scheme for quickstart applications which could explain the debug logs appearing there.

No I didnt, however I am using -FIRDebugEnabled flag and according to the docs if we disable it, my measurements will be affected during testing and development.

If you need more information please let me know.
TIA

@ryanwilson
Copy link
Member

Ahh - thanks for the info! What if you combine -FIRDebugEnabled with -noFIRAnalyticsDebugEnabled? The naming is slightly confusing but I'm fairly certain that the -noFIRAnalyticsDebugEnabled is for Xcode console logging only, not the actual events being passed through.

I'll confirm with the Analytics team that's a reasonable approach as well but worth a go before they are online :)

@rgkobashi
Copy link
Author

I apologize for the late response...
Yes! -noFIRAnalyticsDebugEnabled reduces the logs significantly.

Just to confirm, for now the solution would be to use -noFIRAnalyticsDebugEnabled flag and once the bug when sending LoggerLevel is fix, I guess the logs will be reduced even more?

Thanks!

@paulb777
Copy link
Member

paulb777 commented Jun 1, 2020

I'm going to close here in favor of continued related conversation in #5704

@paulb777 paulb777 closed this as completed Jun 1, 2020
@firebase firebase locked and limited conversation to collaborators Jul 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants