-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Update logging example to retrieve the default handler #3691
Conversation
logging/cloud-client/handler.py
Outdated
@@ -1,6 +1,6 @@ | |||
#!/usr/bin/env python | |||
|
|||
# Copyright 2016 Google Inc. All Rights Reserved. | |||
# Copyright 2020 Google Inc. All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't update the copyright year
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
logging/cloud-client/handler.py
Outdated
@@ -1,6 +1,6 @@ | |||
#!/usr/bin/env python | |||
|
|||
# Copyright 2016 Google Inc. All Rights Reserved. | |||
# Copyright 2020 Google Inc. All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
…leCloudPlatform/python-docs-samples#3691) * Update handler.py * Update README.rst * Update handler.py Co-authored-by: Kurtis Van Gent <31518063+kurtisvg@users.noreply.github.com>
…leCloudPlatform/python-docs-samples#3691) * Update handler.py * Update README.rst * Update handler.py Co-authored-by: Kurtis Van Gent <31518063+kurtisvg@users.noreply.github.com>
…leCloudPlatform/python-docs-samples#3691) * Update handler.py * Update README.rst * Update handler.py Co-authored-by: Kurtis Van Gent <31518063+kurtisvg@users.noreply.github.com>
This change makes the code sample usable for App Engine apps as well as other environments.
When a Logging client asks for the default handler, Logging returns a handler that is appropriate for the environment the client is running in. When the code is running in App Engine, AppEngineHandler is returned, and this is needed to enable key logging features in App Engine, such as correlating app logs with request logs.
Here's info about get_default_handler():
https://googleapis.dev/python/logging/latest/client.html
This change also updates branding to "Cloud Logging".