-
Notifications
You must be signed in to change notification settings - Fork 625
Add console URL logging. #2632
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 console URL logging. #2632
Conversation
Coverage ReportAffected SDKsNo changes between base commit (4bc47df) and head commit (bae2c583). Test Logs
NotesHTML coverage reports can be produced locally with Head commit (bae2c583) is created by Prow via merging commits: 4bc47df f4c3ecd. |
Binary Size ReportAffected SDKs
Test Logs
NotesHead commit (bae2c583) is created by Prow via merging commits: 4bc47df f4c3ecd. |
/test check-changed |
firebase-perf/src/main/java/com/google/firebase/perf/FirebasePerformance.java
Outdated
Show resolved
Hide resolved
firebase-perf/src/main/java/com/google/firebase/perf/logging/ConsoleUrlGenerator.java
Outdated
Show resolved
Hide resolved
firebase-perf/src/main/java/com/google/firebase/perf/logging/ConsoleUrlGenerator.java
Outdated
Show resolved
Hide resolved
firebase-perf/src/main/java/com/google/firebase/perf/transport/TransportManager.java
Show resolved
Hide resolved
firebase-perf/src/main/java/com/google/firebase/perf/transport/TransportManager.java
Show resolved
Hide resolved
firebase-perf/src/main/java/com/google/firebase/perf/logging/ConsoleUrlGenerator.java
Show resolved
Hide resolved
firebase-perf/src/main/java/com/google/firebase/perf/transport/TransportManager.java
Show resolved
Hide resolved
/test check-changed |
firebase-perf/src/main/java/com/google/firebase/perf/logging/ConsoleUrlGenerator.java
Outdated
Show resolved
Hide resolved
firebase-perf/src/main/java/com/google/firebase/perf/transport/TransportManager.java
Show resolved
Hide resolved
@@ -191,6 +193,14 @@ public static FirebasePerformance getInstance() { | |||
gaugeManager.setApplicationContext(appContext); | |||
|
|||
mPerformanceCollectionForceEnabledState = configResolver.getIsPerformanceCollectionEnabled(); | |||
if (isPerformanceCollectionEnabled()) { | |||
Log.i( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you use the AndroidLogger instead of exposing the LogWrapper? It has the added advantage that it already does the check as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The purpose is to log regardless of isLogcatEnabled
defined in AndroidLogger
. We want to log the console URL if FirebasePerformance is initialized per run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation. If isLogcatEnabled = false
, wouldn't logging go against the user's expectation / desires?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. This decision is made based on the fact that not many developers will turn on the isLogcatEnabled
and the flag is off by default. As a result, we would like to log only the dashboard URL only once per run. Happy to hear your thoughts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeremyjiang-dev How are we logging in the rest of the Firebase codebase? I would align with that. I would not recommend to supersede the choice of the developer to show/hide console logs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not recommend to supersede the choice of the developer to show/hide console logs
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sg. I should have highlighted this in the design doc to catch attention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
firebase-perf/src/test/java/com/google/firebase/perf/logging/ConsoleUrlGeneratorTest.java
Outdated
Show resolved
Hide resolved
firebase-perf/src/main/java/com/google/firebase/perf/logging/ConsoleUrlGenerator.java
Show resolved
Hide resolved
@@ -191,6 +193,14 @@ public static FirebasePerformance getInstance() { | |||
gaugeManager.setApplicationContext(appContext); | |||
|
|||
mPerformanceCollectionForceEnabledState = configResolver.getIsPerformanceCollectionEnabled(); | |||
if (isPerformanceCollectionEnabled()) { | |||
Log.i( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not recommend to supersede the choice of the developer to show/hide console logs
+1
See go/fireperf-logging-console-links-on-client Option 6 Log the URL for every trace metrics