-
Notifications
You must be signed in to change notification settings - Fork 54
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
fix: move manual code to logging_v2 #83
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
91368c4
chore: move manual code to logging_v2
busunkim96 5cdf501
test: fix import
busunkim96 0c2e154
fix: fix docs and lint
busunkim96 b1e7cce
fix: fix availability of __version__, Client
busunkim96 5231d95
fix: synchronize logging and logging_v2
busunkim96 1aa0294
fix: remove generated clients from __all__
busunkim96 fc7c231
test: fix system test
busunkim96 046d787
chore: blacken
busunkim96 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Cloud Logging Client | ||
========================== | ||
|
||
.. automodule:: google.cloud.logging.client | ||
.. automodule:: google.cloud.logging_v2.client | ||
:members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Entries | ||
======= | ||
|
||
.. automodule:: google.cloud.logging.entries | ||
.. automodule:: google.cloud.logging_v2.entries | ||
:members: | ||
:show-inheritance: | ||
:member-order: groupwise |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Google App Engine flexible Log Handler | ||
====================================== | ||
|
||
.. automodule:: google.cloud.logging.handlers.app_engine | ||
.. automodule:: google.cloud.logging_v2.handlers.app_engine | ||
:members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Google Kubernetes Engine Log Handler | ||
==================================== | ||
|
||
.. automodule:: google.cloud.logging.handlers.container_engine | ||
.. automodule:: google.cloud.logging_v2.handlers.container_engine | ||
:members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Python Logging Module Handler | ||
============================== | ||
|
||
.. automodule:: google.cloud.logging.handlers.handlers | ||
.. automodule:: google.cloud.logging_v2.handlers.handlers | ||
:members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Logger | ||
====== | ||
|
||
.. automodule:: google.cloud.logging.logger | ||
.. automodule:: google.cloud.logging_v2.logger | ||
:members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Metrics | ||
======= | ||
|
||
.. automodule:: google.cloud.logging.metric | ||
.. automodule:: google.cloud.logging_v2.metric | ||
:members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Sinks | ||
===== | ||
|
||
.. automodule:: google.cloud.logging.sink | ||
.. automodule:: google.cloud.logging_v2.sink | ||
:members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Python Logging Handler Sync Transport | ||
====================================== | ||
|
||
.. automodule:: google.cloud.logging.handlers.transports.base | ||
.. automodule:: google.cloud.logging_v2.handlers.transports.base | ||
:members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Python Logging Handler Sync Transport | ||
====================================== | ||
|
||
.. automodule:: google.cloud.logging.handlers.transports.sync | ||
.. automodule:: google.cloud.logging_v2.handlers.transports.sync | ||
:members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't
logging
meant to be an alias oflogging_v2
? Right now it looks like they expose different modules. I can't dologging.logger
, but I can dologging_v2.logger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I messed this up.
I think where I'd like to go with this is what Firestore has:
google/cloud/firestore.py
(shim)google/cloud/firestore_v1/__init__.py
The class
Client
(not the moduleclient
) is placed in__all__
, so you can import it underlogging_v2
/logging
.Does that sound alright to you?
This is different from what I have at the current commit (exporting modules) which I don't think makes sense for anything but
handlers
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that first one looks good!
What do you think we should do with the auto-generated API (currently in
logging_v2
)? I want to discourage users from using the auto-generated modules and use it mostly internally, but there may be some gaps in the hand-written code for now, and it may make sense to allow users to "break the glass". Maybe export them aslogging.gapic.MetricsServiceV2Client
? What do you think?Also, an issue with
from google.cloud import logging
is that it collides with thelogging
standard library, and they are often going to be used together. Right now we tell users to import asimport google.cloud.logging
and use the full path in their code. I wonder if it would make sense to rename the library togoogle.cloud.cloudlogging
or something so there's no naming conflictThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I can remove the generated clients from
__all__
and make them available throughlogging_v2.gapic.MetricServiceV2Client
. This is similar to what you have to do to get to the transport layer in microgenerated clients.Ah I didn't realize that was a problem. This is definitely a good time to do any naming changes. The generator is flexible on namespacing, so it is really up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, that would be great!
Hmm ok, I'll discuss this with the team and get back to you. Let me know if you have strong opinions one way or the other, because I can definitely see pros and cons to each
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I've removed the 3 generated clients from
logging_v2
/logging
. PTAL. Also opened #88 to track a potential naming change.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good for the most part, but I noticed that some modules are still only accessible through
logging_v2
rather thanlogging
. Likegoogle.cloud.logging_v2.sink
andgoogle.cloud.logging_v2.metric
. Shouldn't the alias be the same for both?Edit: actually, it looks like the important classes are already exported from each of those files. I think it looks good then!