Skip to content

[AI] Enable Ktor logging for debug builds in firebase-ai#7962

Open
rlazo wants to merge 3 commits intomainfrom
rl.push.to.ktor
Open

[AI] Enable Ktor logging for debug builds in firebase-ai#7962
rlazo wants to merge 3 commits intomainfrom
rl.push.to.ktor

Conversation

@rlazo
Copy link
Contributor

@rlazo rlazo commented Mar 24, 2026

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.

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.
@gemini-code-assist
Copy link
Contributor

Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 24, 2026

📝 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.

@google-oss-bot
Copy link
Collaborator

1 Warning
⚠️ Did you forget to add a changelog entry? (Add the 'no-changelog' label to the PR to silence this warning.)

Generated by 🚫 Danger

@rlazo
Copy link
Contributor Author

rlazo commented Mar 24, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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

Successfully merging this pull request may close these issues.

2 participants