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

dataconnect: FirebaseDataConnect.logLevel changed to MutableStateFlow #6586

Merged
merged 15 commits into from
Dec 11, 2024

Conversation

dconeybe
Copy link
Contributor

@dconeybe dconeybe commented Dec 10, 2024

Change the property FirebaseDataConnect.logLevel from LogLevel to MutableStateFlow<LogLevel>.

Being a MutableStateFlow enables applications to not only get and set its value, but also enables "collecting" the flow to be notified when its value changes. This can be useful, for example, to keep a UI element that reflects the log level (e.g. a "debug" checkbox) in sync with the actual log level in effect.

This PR also adds logcat messages to be emitted when the log level changes. This can be useful when examining logs after the fact to explain gaps in the logs (e.g. log level was unknowingly reduced to NONE, causing no logs to be emitted). The log messages look like this:

Log level set to WARN
Log level changed to DEBUG (was WARN)
Log level changed to WARN (was DEBUG)

Copy link
Contributor

github-actions bot commented Dec 10, 2024

📝 PRs merging into main branch

Our main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released.

Copy link
Contributor

Vertex AI Mock Responses Check ⚠️

A newer major version of the mock responses for Vertex AI unit tests is available. update_responses.sh should be updated to clone the latest version of the responses: v5.2

@google-oss-bot
Copy link
Contributor

The public api surface has changed for the subproject firebase-dataconnect:
error: Method com.google.firebase.dataconnect.DataConnectLogging.getFlow has changed return type from kotlinx.coroutines.flow.StateFlow<com.google.firebase.dataconnect.LogLevel> to kotlinx.coroutines.flow.Flow<com.google.firebase.dataconnect.LogLevel> [ChangedType]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Dec 10, 2024

Coverage Report 1

Affected Products

  • firebase-dataconnect

    Overall coverage changed from 14.12% (2b072d9) to 14.82% (2a0d17a) by +0.70%.

    FilenameBase (2b072d9)Merge (2a0d17a)Diff
    Logger.kt52.17%73.68%+21.51%
    LogLevel.kt100.00%72.73%-27.27%

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/dSWFimuQfp.html

Copy link
Contributor

github-actions bot commented Dec 10, 2024

Test Results

   64 files   -    972     64 suites   - 972   1m 6s ⏱️ - 33m 19s
  542 tests  -  5 331    541 ✅  -  5 310  1 💤  - 21  0 ❌ ±0 
1 084 runs   - 10 747  1 082 ✅  - 10 705  2 💤  - 42  0 ❌ ±0 

Results for commit 7631f77. ± Comparison against base commit 2b072d9.

This pull request removes 5332 and adds 1 tests. Note that renamed tests count towards both.
com.google.android.datatransport.cct.CctBackendFactoryTest ‑ create_returnCCTBackend_WhenBackendNameIsCCT
com.google.android.datatransport.cct.CctDestinationTest ‑ cctDestination_shouldOnlySupportProtoAndJson
com.google.android.datatransport.cct.CctDestinationTest ‑ cctDestination_shouldSupportProtoAndJson
com.google.android.datatransport.cct.CctTransportBackendTest ‑ decorate_whenOffline_shouldProperlyPopulateNetworkInfo
com.google.android.datatransport.cct.CctTransportBackendTest ‑ decorate_whenOnline_shouldProperlyPopulateNetworkInfo
com.google.android.datatransport.cct.CctTransportBackendTest ‑ schedule_shouldAddCookieOnPseudonymousIds
com.google.android.datatransport.cct.CctTransportBackendTest ‑ schedule_shouldDropCookieOnMixedPseudonymousIds
com.google.android.datatransport.cct.CctTransportBackendTest ‑ send_CompressedResponseIsUncompressed
com.google.android.datatransport.cct.CctTransportBackendTest ‑ send_whenBackendRedirectsMoreThan5Times_shouldOnlyRedirect4Times
com.google.android.datatransport.cct.CctTransportBackendTest ‑ send_whenBackendRedirects_shouldCorrectlyFollowTheRedirectViaPost
…
com.google.firebase.dataconnect.LoggerUnitTest ‑ noisiestOf()

♻️ This comment has been updated with latest results.

@google-oss-bot
Copy link
Contributor

The public api surface has changed for the subproject firebase-dataconnect:
error: Method com.google.firebase.dataconnect.DataConnectLogging.getFlow has changed return type from kotlinx.coroutines.flow.StateFlow<com.google.firebase.dataconnect.LogLevel> to kotlinx.coroutines.flow.Flow<com.google.firebase.dataconnect.LogLevel> [ChangedType]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Dec 10, 2024

Size Report 1

Affected Products

  • firebase-dataconnect

    TypeBase (2b072d9)Merge (2a0d17a)Diff
    aar703 kB709 kB+5.44 kB (+0.8%)
    apk (release)10.0 MB10.0 MB+3.17 kB (+0.0%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/pOKt4NYq0A.html

…dataconnect:generateApiTxtFile`, changing StateFlow to Flow
@dconeybe dconeybe removed the request for review from aashishpatil-g December 10, 2024 16:53
@dconeybe dconeybe marked this pull request as draft December 10, 2024 16:53
@dconeybe
Copy link
Contributor Author

I'm writing an API proposal for this PR, and, in doing so, will be changing a lot of the new API surface. Please hold off reviewing for now.

@google-oss-bot
Copy link
Contributor

The public api surface has changed for the subproject firebase-dataconnect:
error: Method com.google.firebase.dataconnect.DataConnectLogging.getFlow has changed return type from kotlinx.coroutines.flow.Flow<com.google.firebase.dataconnect.LogLevel> to kotlinx.coroutines.flow.Flow [ChangedType]
error: Added method com.google.firebase.dataconnect.DataConnectLogging.getState() [AddedAbstractMethod]
error: Removed method com.google.firebase.dataconnect.DataConnectLogging.push(com.google.firebase.dataconnect.LogLevel) [RemovedMethod]
error: Removed class com.google.firebase.dataconnect.DataConnectLogging.LogLevelStackFrame [RemovedInterface]
error: Method com.google.firebase.dataconnect.FirebaseDataConnectKt.getLogging has changed return type from com.google.firebase.dataconnect.DataConnectLogging to com.google.firebase.dataconnect.DataConnectLogging<?> [ChangedType]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

@dconeybe dconeybe changed the title dataconnect: FirebaseDataConnect.logging added dataconnect: FirebaseDataConnect.logLeve changed to MutableStateFlow Dec 11, 2024
@dconeybe dconeybe changed the title dataconnect: FirebaseDataConnect.logLeve changed to MutableStateFlow dataconnect: FirebaseDataConnect.logLevel changed to MutableStateFlow Dec 11, 2024
@dconeybe dconeybe marked this pull request as ready for review December 11, 2024 19:30
@dconeybe dconeybe merged commit 8130292 into main Dec 11, 2024
40 checks passed
@dconeybe dconeybe deleted the dconeybe/dataconnect/LogLevelFlow branch December 11, 2024 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants