Skip to content

Commit

Permalink
Fix untested snippet examples. (#3219)
Browse files Browse the repository at this point in the history
  • Loading branch information
daspecster authored and lukesneeringer committed Mar 30, 2017
1 parent 0faaf54 commit e2921c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions docs/logging-stdlib-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ You can also exclude certain loggers:

.. code-block:: python
>>> setup_logging(handler, excluded_loggers=('werkzeug',)))
>>> setup_logging(handler, excluded_loggers=('werkzeug',))
Expand All @@ -68,4 +68,3 @@ The Python logging handler can use different transports. The default is

1. :class:`google.cloud.logging.handlers.SyncTransport` this handler does a direct API call on each
logging statement to write the entry.

5 changes: 3 additions & 2 deletions logging/google/cloud/logging/handlers/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class CloudLoggingHandler(logging.StreamHandler):
.. code-block:: python
import logging
import google.cloud.logging
from google.cloud.logging.handlers import CloudLoggingHandler
Expand All @@ -62,7 +63,7 @@ class CloudLoggingHandler(logging.StreamHandler):
cloud_logger.setLevel(logging.INFO)
cloud_logger.addHandler(handler)
cloud.logger.error('bad news') # API call
cloud_logger.error('bad news') # API call
"""

Expand Down Expand Up @@ -117,7 +118,7 @@ def setup_logging(handler, excluded_loggers=EXCLUDED_LOGGER_DEFAULTS,
client = google.cloud.logging.Client()
handler = CloudLoggingHandler(client)
google.cloud.logging.setup_logging(handler)
google.cloud.logging.handlers.setup_logging(handler)
logging.getLogger().setLevel(logging.DEBUG)
logging.error('bad news') # API call
Expand Down

0 comments on commit e2921c7

Please sign in to comment.