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

[Vertex AI] Update logging details from Google AI SDK #12933

Merged
merged 3 commits into from
May 10, 2024

Conversation

andrewheard
Copy link
Contributor

  • Changed (or added) logging tags from [GoogleGenerativeAI] to [FirebaseVertexAI].
  • Switched to -FIRDebugEnabled as the launch argument to enable additional logging.
    • -GoogleGenerativeAIDebugLogEnabled is still accepted with a warning message.
  • Updated additional logging instructions with new tag and argument.
    • No longer prints "To enable additional logging, add -GoogleGenerativeAIDebugLogEnabled as a launch argument in Xcode." when additional logging is already enabled.

#no-changelog

@@ -18,13 +18,19 @@ import OSLog
@available(iOS 15.0, macOS 11.0, macCatalyst 15.0, *)
struct Logging {
/// Subsystem that should be used for all Loggers.
static let subsystem = "com.google.generative-ai"
static let subsystem = "com.google.firebase.vertex-ai"
Copy link
Member

Choose a reason for hiding this comment

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

It seems that subsystem is redundant with [FirebaseVertexAI]? I'm fine to leave that as a future question.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for bringing it up, @paulb777. It is largely redundant given that a Firebase dev would need to filter by tag (like [FirebaseVertexAI]) since the rest of our SDKs print like this. However, if we were to migrate everything to OSLog in the future it would actually be [FirebaseVertexAI] that would be redundant (along with -FIRDebugEnabled). Rather than setting a log level as a launch argument in Xcode, with OSLog it's easy to filter by levels and subsystems in the Xcode UI, e.g.:
Xcode OSLog Screenshot
In the above, I've enabled the option to display the subsystem and to filter by it, as well as log level. Definitely more flexible to tweak these as needed without having to restart the app. These options are also available in the Console app.

For now I'll leave it in (alternative is an empty string, like we did for category, since the parameter is non-optional) but we can adjust later or migrate to FirebaseLogger.

@andrewheard andrewheard merged commit 9e19563 into release-10.26 May 10, 2024
42 checks passed
@andrewheard andrewheard deleted the ah/vertex-logging-tags branch May 10, 2024 18:07
@firebase firebase locked and limited conversation to collaborators Jun 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants