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

docs: add initialization of LogEntry instance in the v2 example #46

Merged
merged 3 commits into from Jul 1, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.rst
@@ -1,7 +1,7 @@
Python Client for Stackdriver Logging
=====================================

|pypi| |versions|
|pypi| |versions|

`Stackdriver Logging API`_: Writes log entries and manages your Stackdriver
Logging configuration.
Expand Down Expand Up @@ -84,7 +84,9 @@ Using the API
from google.cloud import logging_v2

client = logging_v2.LoggingServiceV2Client()
entries = []
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Though this PR only changed the issue that the list entries is empty, I think we need to add how to set resources and log_name. What do you think?

Choose a reason for hiding this comment

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

Yes, that would be useful to have too.

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, I added the note.

e = logging_v2.types.LogEntry(
text_payload="text")

Choose a reason for hiding this comment

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

please update "Text" to something more meaningful, like "this is a log statement"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used the exact phrase :)

entries = [e]
response = client.write_log_entries(entries)

.. code:: python
Expand Down