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

Initial sketch of logging API usage docs. #1488

Closed
wants to merge 19 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename the 'log' factory -> 'logger'.
More Pythonic name, even though the backend calls it 'log'.

Addresses:
#1488 (comment)
  • Loading branch information
tseaver committed Feb 19, 2016
commit 276b27b7d1665a4761c0777e2082331a5f7f0fd2
20 changes: 10 additions & 10 deletions docs/logging-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@ Authentication and Configuration
Writing log entries

This comment was marked as spam.

This comment was marked as spam.

-------------------

Write a simple text entry to a log.
Write a simple text entry to a logger.

.. doctest::

>>> from gcloud import logging
>>> client = logging.Client()
>>> log = client.log('log_name')
>>> log.text("A simple entry") # API call
>>> logger = client.logger('log_name')
>>> logger.text("A simple entry") # API call

Write a dictionary entry to a log.
Write a dictionary entry to a logger.

.. doctest::

>>> from gcloud import logging
>>> client = logging.Client()
>>> log = client.log('log_name')
>>> log.struct(
>>> logger = client.logger('log_name')
>>> logger.struct(
... message="My second entry",
... weather="partly cloudy") # API call

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.


Expand Down Expand Up @@ -113,15 +113,15 @@ Retrieve entities in batches of 10, iterating until done.
... break


Delete all entries for a log
----------------------------
Delete all entries for a logger
-------------------------------

.. doctest::

>>> from gcloud import logging
>>> client = logging.Client()
>>> log = client.log('log_name')
>>> log.delete() # API call
>>> logger = client.logger('log_name')
>>> logger.delete() # API call

This comment was marked as spam.

This comment was marked as spam.



Manage log metrics
Expand Down