Skip to content

Commit bfac2a4

Browse files
dhermeslandrito
authored andcommitted
Revert "Fix "broken" docs build. (googleapis#3422)" (googleapis#3439)
This reverts commit a849060.
1 parent db38de0 commit bfac2a4

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

docs/logging/usage.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ Authentication and Configuration
4141
.. literalinclude:: snippets.py
4242
:start-after: [START client_create_default]
4343
:end-before: [END client_create_default]
44+
:dedent: 4
4445

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

4748
.. literalinclude:: snippets.py
4849
:start-after: [START client_create_explicit]
4950
:end-before: [END client_create_explicit]
51+
:dedent: 4
5052

5153

5254
Writing log entries
@@ -59,18 +61,21 @@ which to associate the entries:
5961
.. literalinclude:: snippets.py
6062
:start-after: [START logger_create]
6163
:end-before: [END logger_create]
64+
:dedent: 4
6265

6366
Write a simple text entry to the logger.
6467

6568
.. literalinclude:: snippets.py
6669
:start-after: [START logger_log_text]
6770
:end-before: [END logger_log_text]
71+
:dedent: 4
6872

6973
Write a dictionary entry to the logger.
7074

7175
.. literalinclude:: snippets.py
7276
:start-after: [START logger_log_struct]
7377
:end-before: [END logger_log_struct]
78+
:dedent: 4
7479

7580

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

8591
Fetch entries across multiple projects.
8692

8793
.. literalinclude:: snippets.py
8894
:start-after: [START client_list_entries_multi_project]
8995
:end-before: [END client_list_entries_multi_project]
96+
:dedent: 4
9097

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

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

101109
Sort entries in descending timestamp order.
102110

103111
.. literalinclude:: snippets.py
104112
:start-after: [START client_list_entries_order_by]
105113
:end-before: [END client_list_entries_order_by]
114+
:dedent: 4
106115

107116
Retrieve entries in batches of 10, iterating until done.
108117

109118
.. literalinclude:: snippets.py
110119
:start-after: [START client_list_entries_paged]
111120
:end-before: [END client_list_entries_paged]
121+
:dedent: 4
112122

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

115125
.. literalinclude:: snippets.py
116126
:start-after: [START logger_list_entries]
117127
:end-before: [END logger_list_entries]
128+
:dedent: 4
118129

119130

120131
Delete all entries for a logger
@@ -123,6 +134,7 @@ Delete all entries for a logger
123134
.. literalinclude:: snippets.py
124135
:start-after: [START logger_delete]
125136
:end-before: [END logger_delete]
137+
:dedent: 8
126138

127139

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

140153
Create a metric:
141154

142155
.. literalinclude:: snippets.py
143156
:start-after: [START metric_create]
144157
:end-before: [END metric_create]
158+
:dedent: 4
145159

146160
Refresh local information about a metric:
147161

148162
.. literalinclude:: snippets.py
149163
:start-after: [START metric_reload]
150164
:end-before: [END metric_reload]
165+
:dedent: 4
151166

152167
Update a metric:
153168

154169
.. literalinclude:: snippets.py
155170
:start-after: [START metric_update]
156171
:end-before: [END metric_update]
172+
:dedent: 4
157173

158174
Delete a metric:
159175

160176
.. literalinclude:: snippets.py
161177
:start-after: [START metric_delete]
162178
:end-before: [END metric_delete]
179+
:dedent: 4
163180

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

185203
Create a Cloud Storage sink:
186204

187205
.. literalinclude:: snippets.py
188206
:start-after: [START sink_storage_create]
189207
:end-before: [END sink_storage_create]
208+
:dedent: 4
190209

191210

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

206226
Create a BigQuery sink:
207227

208228
.. literalinclude:: snippets.py
209229
:start-after: [START sink_bigquery_create]
210230
:end-before: [END sink_bigquery_create]
231+
:dedent: 4
211232

212233

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

227249
Create a Cloud Pub/Sub sink:
228250

229251
.. literalinclude:: snippets.py
230252
:start-after: [START sink_pubsub_create]
231253
:end-before: [END sink_pubsub_create]
254+
:dedent: 4
232255

233256
Manage Sinks
234257
~~~~~~~~~~~~
@@ -238,24 +261,28 @@ List all sinks for a project:
238261
.. literalinclude:: snippets.py
239262
:start-after: [START client_list_sinks]
240263
:end-before: [END client_list_sinks]
264+
:dedent: 4
241265

242266
Refresh local information about a sink:
243267

244268
.. literalinclude:: snippets.py
245269
:start-after: [START sink_reload]
246270
:end-before: [END sink_reload]
271+
:dedent: 4
247272

248273
Update a sink:
249274

250275
.. literalinclude:: snippets.py
251276
:start-after: [START sink_update]
252277
:end-before: [END sink_update]
278+
:dedent: 4
253279

254280
Delete a sink:
255281

256282
.. literalinclude:: snippets.py
257283
:start-after: [START sink_delete]
258284
:end-before: [END sink_delete]
285+
:dedent: 4
259286

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

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

282311
.. note::
283312

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

293323
Cloud Logging Handler
294324
~~~~~~~~~~~~~~~~~~~~~
@@ -302,6 +332,7 @@ which will write directly to the API.
302332
.. literalinclude:: snippets.py
303333
:start-after: [START create_cloud_handler]
304334
:end-before: [END create_cloud_handler]
335+
:dedent: 4
305336

306337
.. note::
307338

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

321353
Cloud Logging Handler transports
322354
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

nox.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def docs(session):
2626

2727
# Install Sphinx and also all of the google-cloud-* packages.
2828
session.chdir(os.path.realpath(os.path.dirname(__file__)))
29-
session.install('sphinx', 'sphinx_rtd_theme')
29+
session.install('Sphinx >= 1.6.2', 'sphinx_rtd_theme')
3030
session.install(
3131
'core/', 'bigquery/', 'bigtable/', 'datastore/', 'dns/', 'language/',
3232
'logging/', 'error_reporting/', 'monitoring/', 'pubsub/',

pubsub/google/cloud/pubsub/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ def topic(self, name, timestamp_messages=False):
226226
.. literalinclude:: snippets.py
227227
:start-after: [START client_topic]
228228
:end-before: [END client_topic]
229+
:dedent: 4
229230
230231
:type name: str
231232
:param name: the name of the topic to be constructed.
@@ -248,6 +249,7 @@ def subscription(self, name, ack_deadline=None, push_endpoint=None,
248249
.. literalinclude:: snippets.py
249250
:start-after: [START client_subscription]
250251
:end-before: [END client_subscription]
252+
:dedent: 4
251253
252254
:type name: str
253255
:param name: the name of the subscription to be constructed.

storage/google/cloud/storage/blob.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ def download_to_file(self, file_obj, client=None):
442442
.. literalinclude:: snippets.py
443443
:start-after: [START download_to_file]
444444
:end-before: [END download_to_file]
445+
:dedent: 4
445446
446447
The ``encryption_key`` should be a str or bytes with a length of at
447448
least 32.
@@ -843,6 +844,7 @@ def upload_from_file(self, file_obj, rewind=False, size=None,
843844
.. literalinclude:: snippets.py
844845
:start-after: [START upload_from_file]
845846
:end-before: [END upload_from_file]
847+
:dedent: 4
846848
847849
The ``encryption_key`` should be a str or bytes with a length of at
848850
least 32.

0 commit comments

Comments
 (0)