From 2a59d59277437719eaebd6dda3952c7b25d908da Mon Sep 17 00:00:00 2001 From: Nicole Zhu <69952136+nicoleczhu@users.noreply.github.com> Date: Wed, 3 Feb 2021 13:44:17 -0800 Subject: [PATCH 1/6] docs: add existing region tag to python std logging This is so this existing Python example will show up here: https://cloud.google.com/logging/docs/samples/logging-stdlogging --- samples/snippets/handler.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/samples/snippets/handler.py b/samples/snippets/handler.py index 9a63d022f..1d36f12ef 100644 --- a/samples/snippets/handler.py +++ b/samples/snippets/handler.py @@ -14,6 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +# [START logging_stdlogging] def use_logging_handler(): # [START logging_handler_setup] @@ -47,3 +48,5 @@ def use_logging_handler(): if __name__ == "__main__": use_logging_handler() + +# [START logging_stdlogging] From 2bdcdb6a626bc8f0c5cb78c86e5fa341ea365b8e Mon Sep 17 00:00:00 2001 From: Nicole Zhu <69952136+nicoleczhu@users.noreply.github.com> Date: Wed, 3 Feb 2021 13:46:55 -0800 Subject: [PATCH 2/6] Update handler.py --- samples/snippets/handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/handler.py b/samples/snippets/handler.py index 1d36f12ef..8c0d7adb4 100644 --- a/samples/snippets/handler.py +++ b/samples/snippets/handler.py @@ -49,4 +49,4 @@ def use_logging_handler(): if __name__ == "__main__": use_logging_handler() -# [START logging_stdlogging] +# [END logging_stdlogging] From 7a804383f75153668b672b74acba63f804ef2572 Mon Sep 17 00:00:00 2001 From: Nicole Zhu <69952136+nicoleczhu@users.noreply.github.com> Date: Wed, 3 Feb 2021 14:51:33 -0800 Subject: [PATCH 3/6] Update handler.py --- samples/snippets/handler.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/samples/snippets/handler.py b/samples/snippets/handler.py index 8c0d7adb4..ee95e9b74 100644 --- a/samples/snippets/handler.py +++ b/samples/snippets/handler.py @@ -14,9 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -# [START logging_stdlogging] - def use_logging_handler(): + # [START logging_stdlogging] # [START logging_handler_setup] # Imports the Cloud Logging client library import google.cloud.logging @@ -45,8 +44,7 @@ def use_logging_handler(): print("Logged: {}".format(text)) - + # [END logging_stdlogging] if __name__ == "__main__": use_logging_handler() -# [END logging_stdlogging] From 86a868b83c62e7595b6924add2cbd8269832f64d Mon Sep 17 00:00:00 2001 From: Nicole Zhu <69952136+nicoleczhu@users.noreply.github.com> Date: Wed, 3 Feb 2021 16:43:57 -0800 Subject: [PATCH 4/6] Update handler.py --- samples/snippets/handler.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/samples/snippets/handler.py b/samples/snippets/handler.py index ee95e9b74..9e840a2bb 100644 --- a/samples/snippets/handler.py +++ b/samples/snippets/handler.py @@ -43,8 +43,7 @@ def use_logging_handler(): # [END logging_handler_usage] print("Logged: {}".format(text)) - # [END logging_stdlogging] + if __name__ == "__main__": use_logging_handler() - From b847f336004e8e9aab9878d0e4f6772a70f051ae Mon Sep 17 00:00:00 2001 From: Nicole Zhu <69952136+nicoleczhu@users.noreply.github.com> Date: Thu, 4 Feb 2021 09:39:27 -0800 Subject: [PATCH 5/6] Update handler.py --- samples/snippets/handler.py | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/snippets/handler.py b/samples/snippets/handler.py index 9e840a2bb..8181b7d57 100644 --- a/samples/snippets/handler.py +++ b/samples/snippets/handler.py @@ -47,3 +47,4 @@ def use_logging_handler(): if __name__ == "__main__": use_logging_handler() + From f688ecc5b98a443819cb17ab10b4c9cc53470fa7 Mon Sep 17 00:00:00 2001 From: nicoleczhu Date: Thu, 4 Feb 2021 10:40:23 -0800 Subject: [PATCH 6/6] style: lint --- samples/snippets/handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/snippets/handler.py b/samples/snippets/handler.py index 8181b7d57..0a708c138 100644 --- a/samples/snippets/handler.py +++ b/samples/snippets/handler.py @@ -14,6 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + def use_logging_handler(): # [START logging_stdlogging] # [START logging_handler_setup] @@ -45,6 +46,6 @@ def use_logging_handler(): print("Logged: {}".format(text)) # [END logging_stdlogging] + if __name__ == "__main__": use_logging_handler() -