-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Update logging samples to fit new style guide and match Node.js samples. #435
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
Conversation
Sorry for the big change, I screwed myself because I wrote half of these before I realized there were existing samples. |
This is going to break the include tags on https://cloud.google.com/logging/docs/api/tasks/creating-logs |
I know, I'll handle updating docs. |
fd53bd3
to
3e98e9e
Compare
|
||
print('Latest entries for logger {}:'.format(logger.name)) | ||
|
||
entries, token = logging_client.list_entries( |
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.
Two things:
-
If you don't loop on the token, you're going to have a bad time. The API will return 0 entries at first then return 5 on the next one, the token is also used to indicate "loading"
-
You should just be able to do logger.list() now. There was a gcloud-python bug I fixed that should be released now)
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.
ugh.
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.
Fixed.
Change-Id: I88ff16ebfd4fc2aac6413f97acd43482b15f9cdc
Change-Id: I33928ebde19a29074ac00a26b1eb4bcffe597bfd
3e98e9e
to
ade603b
Compare
@waprin updated, PTAL. |
assert example_sink.filter_ == updated_filter | ||
|
||
|
||
def ttest_delete(example_sink, capsys): |
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.
typo in test name
Change-Id: Ica6bf512afa3cd307a52d4726cf6629ef8678339
@@ -1,4 +1,10 @@ | |||
# Cloud Storage API Samples | |||
# Stackdriver Logging v1 Samples |
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.
I think you messed something up, this is the storage README
Change-Id: I7304e8378e43ebf5ed6c8806b0efd52cacc44310
@@ -1,17 +1,28 @@ | |||
# Google Cloud Logging v1 Samples | |||
# Stackdriver Logging v1 Samples | |||
|
|||
**Note that these samples are for the v1 Samples, using the Google API Client. | |||
It's recommended you instead use the [Logging v2 samples](https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/logging/api), which use the Google | |||
Cloud client library.** | |||
|
|||
This section contains samples for [Google Cloud Logging](https://cloud.google.com/logging). |
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.
s/Google Cloud/Stackdriver/
?
code lgtm, offline organization comments |
Change-Id: Ib6cf1f2d6e9009058ff93d199ad4ffb527208d47
…1.3 (#435) Co-authored-by: Anthonios Partheniou <partheniou@google.com>
…1.3 (#435) Co-authored-by: Anthonios Partheniou <partheniou@google.com>
No description provided.