Importing google.cloud.aiplatform
has side-effects and misconfigures logging
#3667
Labels
api: vertex-ai
Issues related to the googleapis/python-aiplatform API.
Environment details
google-cloud-aiplatform
version:1.47.0
Steps to reproduce
Code example
Gives the output:
This means that any actual diagnostic output from the functions on VertexLogger appears twice in my output. A library should never create a logging handler, and should trust the end user to properly configure logging if desired. And if it HAD to create a logging handler, it shouldn't do so by side-effecting on an import.
For anyone finding this in search, the workaround I've found to prevent this handler creation is to be faster, by ensuring all my entrypoints look something like this:
The text was updated successfully, but these errors were encountered: