Skip to content

Commit

Permalink
Revert "Fix "broken" docs build. (googleapis#3422)" (googleapis#3439)
Browse files Browse the repository at this point in the history
This reverts commit a849060.
  • Loading branch information
dhermes authored and landrito committed Aug 22, 2017
1 parent db38de0 commit bfac2a4
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
32 changes: 32 additions & 0 deletions docs/logging/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ Authentication and Configuration
.. literalinclude:: snippets.py
:start-after: [START client_create_default]
:end-before: [END client_create_default]
:dedent: 4

or pass in ``credentials`` and ``project`` explicitly

.. literalinclude:: snippets.py
:start-after: [START client_create_explicit]
:end-before: [END client_create_explicit]
:dedent: 4


Writing log entries
Expand All @@ -59,18 +61,21 @@ which to associate the entries:
.. literalinclude:: snippets.py
:start-after: [START logger_create]
:end-before: [END logger_create]
:dedent: 4

Write a simple text entry to the logger.

.. literalinclude:: snippets.py
:start-after: [START logger_log_text]
:end-before: [END logger_log_text]
:dedent: 4

Write a dictionary entry to the logger.

.. literalinclude:: snippets.py
:start-after: [START logger_log_struct]
:end-before: [END logger_log_struct]
:dedent: 4


Retrieving log entries
Expand All @@ -81,12 +86,14 @@ Fetch entries for the default project.
.. literalinclude:: snippets.py
:start-after: [START client_list_entries_default]
:end-before: [END client_list_entries_default]
:dedent: 4

Fetch entries across multiple projects.

.. literalinclude:: snippets.py
:start-after: [START client_list_entries_multi_project]
:end-before: [END client_list_entries_multi_project]
:dedent: 4

Filter entries retrieved using the `Advanced Logs Filters`_ syntax

Expand All @@ -97,24 +104,28 @@ Fetch entries for the default project.
.. literalinclude:: snippets.py
:start-after: [START client_list_entries_filter]
:end-before: [END client_list_entries_filter]
:dedent: 4

Sort entries in descending timestamp order.

.. literalinclude:: snippets.py
:start-after: [START client_list_entries_order_by]
:end-before: [END client_list_entries_order_by]
:dedent: 4

Retrieve entries in batches of 10, iterating until done.

.. literalinclude:: snippets.py
:start-after: [START client_list_entries_paged]
:end-before: [END client_list_entries_paged]
:dedent: 4

Retrieve entries for a single logger, sorting in descending timestamp order:

.. literalinclude:: snippets.py
:start-after: [START logger_list_entries]
:end-before: [END logger_list_entries]
:dedent: 4


Delete all entries for a logger
Expand All @@ -123,6 +134,7 @@ Delete all entries for a logger
.. literalinclude:: snippets.py
:start-after: [START logger_delete]
:end-before: [END logger_delete]
:dedent: 8


Manage log metrics
Expand All @@ -136,30 +148,35 @@ List all metrics for a project:
.. literalinclude:: snippets.py
:start-after: [START client_list_metrics]
:end-before: [END client_list_metrics]
:dedent: 4

Create a metric:

.. literalinclude:: snippets.py
:start-after: [START metric_create]
:end-before: [END metric_create]
:dedent: 4

Refresh local information about a metric:

.. literalinclude:: snippets.py
:start-after: [START metric_reload]
:end-before: [END metric_reload]
:dedent: 4

Update a metric:

.. literalinclude:: snippets.py
:start-after: [START metric_update]
:end-before: [END metric_update]
:dedent: 4

Delete a metric:

.. literalinclude:: snippets.py
:start-after: [START metric_delete]
:end-before: [END metric_delete]
:dedent: 4

Export log entries using sinks
------------------------------
Expand All @@ -181,12 +198,14 @@ Add ``[email protected]`` as the owner of the bucket:
.. literalinclude:: snippets.py
:start-after: [START sink_bucket_permissions]
:end-before: [END sink_bucket_permissions]
:dedent: 4

Create a Cloud Storage sink:

.. literalinclude:: snippets.py
:start-after: [START sink_storage_create]
:end-before: [END sink_storage_create]
:dedent: 4


Export to BigQuery
Expand All @@ -202,12 +221,14 @@ See: `Setting permissions for BigQuery`_
.. literalinclude:: snippets.py
:start-after: [START sink_dataset_permissions]
:end-before: [END sink_dataset_permissions]
:dedent: 4

Create a BigQuery sink:

.. literalinclude:: snippets.py
:start-after: [START sink_bigquery_create]
:end-before: [END sink_bigquery_create]
:dedent: 4


Export to Pub/Sub
Expand All @@ -223,12 +244,14 @@ See: `Setting permissions for Pub/Sub`_
.. literalinclude:: snippets.py
:start-after: [START sink_topic_permissions]
:end-before: [END sink_topic_permissions]
:dedent: 4

Create a Cloud Pub/Sub sink:

.. literalinclude:: snippets.py
:start-after: [START sink_pubsub_create]
:end-before: [END sink_pubsub_create]
:dedent: 4

Manage Sinks
~~~~~~~~~~~~
Expand All @@ -238,24 +261,28 @@ List all sinks for a project:
.. literalinclude:: snippets.py
:start-after: [START client_list_sinks]
:end-before: [END client_list_sinks]
:dedent: 4

Refresh local information about a sink:

.. literalinclude:: snippets.py
:start-after: [START sink_reload]
:end-before: [END sink_reload]
:dedent: 4

Update a sink:

.. literalinclude:: snippets.py
:start-after: [START sink_update]
:end-before: [END sink_update]
:dedent: 4

Delete a sink:

.. literalinclude:: snippets.py
:start-after: [START sink_delete]
:end-before: [END sink_delete]
:dedent: 4

Integration with Python logging module
--------------------------------------
Expand All @@ -268,6 +295,7 @@ To automatically pick the default for your current environment, use
.. literalinclude:: snippets.py
:start-after: [START create_default_handler]
:end-before: [END create_default_handler]
:dedent: 4

It is also possible to attach the handler to the root Python logger, so that
for example a plain ``logging.warn`` call would be sent to Stackdriver Logging,
Expand All @@ -278,6 +306,7 @@ to configure this automatically.
.. literalinclude:: snippets.py
:start-after: [START setup_logging]
:end-before: [END setup_logging]
:dedent: 4

.. note::

Expand All @@ -289,6 +318,7 @@ You can also exclude certain loggers:
.. literalinclude:: snippets.py
:start-after: [START setup_logging_excludes]
:end-before: [END setup_logging_excludes]
:dedent: 4

Cloud Logging Handler
~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -302,6 +332,7 @@ which will write directly to the API.
.. literalinclude:: snippets.py
:start-after: [START create_cloud_handler]
:end-before: [END create_cloud_handler]
:dedent: 4

.. note::

Expand All @@ -317,6 +348,7 @@ of the Python logger will be included in the structured log entry under the
.. literalinclude:: snippets.py
:start-after: [START create_named_handler]
:end-before: [END create_named_handler]
:dedent: 4

Cloud Logging Handler transports
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def docs(session):

# Install Sphinx and also all of the google-cloud-* packages.
session.chdir(os.path.realpath(os.path.dirname(__file__)))
session.install('sphinx', 'sphinx_rtd_theme')
session.install('Sphinx >= 1.6.2', 'sphinx_rtd_theme')
session.install(
'core/', 'bigquery/', 'bigtable/', 'datastore/', 'dns/', 'language/',
'logging/', 'error_reporting/', 'monitoring/', 'pubsub/',
Expand Down
2 changes: 2 additions & 0 deletions pubsub/google/cloud/pubsub/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ def topic(self, name, timestamp_messages=False):
.. literalinclude:: snippets.py
:start-after: [START client_topic]
:end-before: [END client_topic]
:dedent: 4
:type name: str
:param name: the name of the topic to be constructed.
Expand All @@ -248,6 +249,7 @@ def subscription(self, name, ack_deadline=None, push_endpoint=None,
.. literalinclude:: snippets.py
:start-after: [START client_subscription]
:end-before: [END client_subscription]
:dedent: 4
:type name: str
:param name: the name of the subscription to be constructed.
Expand Down
2 changes: 2 additions & 0 deletions storage/google/cloud/storage/blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ def download_to_file(self, file_obj, client=None):
.. literalinclude:: snippets.py
:start-after: [START download_to_file]
:end-before: [END download_to_file]
:dedent: 4
The ``encryption_key`` should be a str or bytes with a length of at
least 32.
Expand Down Expand Up @@ -843,6 +844,7 @@ def upload_from_file(self, file_obj, rewind=False, size=None,
.. literalinclude:: snippets.py
:start-after: [START upload_from_file]
:end-before: [END upload_from_file]
:dedent: 4
The ``encryption_key`` should be a str or bytes with a length of at
least 32.
Expand Down

0 comments on commit bfac2a4

Please sign in to comment.