Skip to content

Conversation

@daniel-sanche
Copy link
Contributor

We give users two packages: logging_v2 for the current version of the library, and logging as the alias.

We found the alias was only exporting paths at the library root, which was not what users expected. This meant they could not run
from google.cloud.logging.handlers import CloudLoggingHandler.

Instead they had to run

from google.cloud.logging import handlers handlers.CloudLoggingHandler 

This PR adds more __init__.py files to advertise sub-modules for the handlers. I avoided doing the same for the gapic directories (/proto, /services, /types) because we want to discourage end-users from using auto-generated code

Fixes #115 🦕

@daniel-sanche daniel-sanche requested review from a team as code owners December 8, 2020 00:00
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Dec 8, 2020
@product-auto-label product-auto-label bot added the api: logging Issues related to the googleapis/python-logging API. label Dec 8, 2020
@daniel-sanche daniel-sanche added the lang: python Issues specific to Python. label Dec 8, 2020
@daniel-sanche
Copy link
Contributor Author

@busunkim96 let me know if you know a more elegant way to do this

Copy link
Contributor

@busunkim96 busunkim96 left a comment

Choose a reason for hiding this comment

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

This looks good to me. Could you add some unit tests to https://github.com/googleapis/python-logging/blob/master/tests/unit/test_logging_shim.py to make sure this stays in sync with logging_v2.handlers?

@daniel-sanche daniel-sanche merged commit 6843a3a into master Dec 8, 2020
@daniel-sanche daniel-sanche deleted the fix-handler-path branch December 8, 2020 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: logging Issues related to the googleapis/python-logging API. cla: yes This human has signed the Contributor License Agreement. lang: python Issues specific to Python.

2 participants