[AI] Enable Ktor logging for debug builds in firebase-ai#7962
[AI] Enable Ktor logging for debug builds in firebase-ai#7962
Conversation
This change enables network logging for debug variants of the `firebase-ai` SDK to facilitate development and debugging. - Enable `BuildConfig` generation in firebase-ai. - Install Ktor Logging plugin in `APIController` for debug builds, with header sanitization for security (`X-Android-Cert`, `x-goog-api-key`). - Configure `slf4j-simple` for debug builds and `slf4j-nop` for release builds in firebase-ai.
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
📝 PRs merging into main branchOur 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. |
Generated by 🚫 Danger |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refactors the logging setup for the firebase-ai module, enabling BuildConfig and introducing variant-specific logging dependencies: slf4j-nop for release builds and slf4j-simple for debug builds. It also integrates Ktor client logging, which is active only in debug builds and includes header sanitization for X-Android-Cert and x-goog-api-key. A review comment points out that the header sanitization logic currently uses a case-sensitive comparison, which should be updated to be case-insensitive to ensure all relevant headers are correctly sanitized.
This change enables network logging for debug variants of the
firebase-aiSDK to facilitate development and debugging.BuildConfiggeneration in firebase-ai.APIControllerfor debug builds, with header sanitization for security (X-Android-Cert,x-goog-api-key).slf4j-simplefor debug builds andslf4j-nopfor release builds in firebase-ai.