google-cloud-logging 3.13.0__tar.gz → 3.14.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. google_cloud_logging-3.14.0/PKG-INFO +254 -0
  2. google_cloud_logging-3.14.0/README.rst +204 -0
  3. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging/__init__.py +10 -16
  4. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging/gapic_version.py +1 -1
  5. {google_cloud_logging-3.13.0/google/cloud/logging_v2 → google_cloud_logging-3.14.0/google/cloud/logging}/handlers/__init__.py +5 -3
  6. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/__init__.py +13 -13
  7. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/_gapic.py +16 -19
  8. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/_helpers.py +7 -8
  9. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/_instrumentation.py +2 -1
  10. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/client.py +8 -9
  11. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/entries.py +10 -9
  12. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/gapic_version.py +1 -1
  13. {google_cloud_logging-3.13.0/google/cloud/logging → google_cloud_logging-3.14.0/google/cloud/logging_v2}/handlers/__init__.py +5 -3
  14. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/handlers/handlers.py +6 -8
  15. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/handlers/middleware/request.py +0 -1
  16. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/handlers/structured_log.py +7 -5
  17. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/handlers/transports/sync.py +1 -0
  18. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/logger.py +11 -10
  19. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/config_service_v2/async_client.py +24 -17
  20. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/config_service_v2/client.py +55 -40
  21. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/config_service_v2/pagers.py +16 -15
  22. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/config_service_v2/transports/__init__.py +0 -1
  23. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/config_service_v2/transports/base.py +17 -13
  24. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/config_service_v2/transports/grpc.py +8 -10
  25. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/config_service_v2/transports/grpc_asyncio.py +9 -11
  26. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/logging_service_v2/async_client.py +24 -18
  27. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/logging_service_v2/client.py +54 -40
  28. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/logging_service_v2/pagers.py +15 -14
  29. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/logging_service_v2/transports/__init__.py +0 -1
  30. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/logging_service_v2/transports/base.py +16 -11
  31. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/logging_service_v2/transports/grpc.py +14 -15
  32. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/logging_service_v2/transports/grpc_asyncio.py +15 -16
  33. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/metrics_service_v2/async_client.py +22 -15
  34. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/metrics_service_v2/client.py +53 -38
  35. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/metrics_service_v2/pagers.py +8 -7
  36. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/metrics_service_v2/transports/__init__.py +0 -1
  37. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/metrics_service_v2/transports/base.py +16 -11
  38. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/metrics_service_v2/transports/grpc.py +8 -9
  39. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/metrics_service_v2/transports/grpc_asyncio.py +9 -10
  40. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/types/log_entry.py +6 -8
  41. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/types/logging.py +4 -4
  42. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/types/logging_config.py +6 -4
  43. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/types/logging_metrics.py +4 -5
  44. google_cloud_logging-3.14.0/google_cloud_logging.egg-info/PKG-INFO +254 -0
  45. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google_cloud_logging.egg-info/SOURCES.txt +0 -2
  46. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google_cloud_logging.egg-info/requires.txt +5 -4
  47. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/setup.py +15 -9
  48. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/system/gapic/v2/test_system_logging_service_v2_v2.py +21 -2
  49. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/system/test_system.py +65 -39
  50. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/gapic/logging_v2/test_config_service_v2.py +278 -82
  51. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/gapic/logging_v2/test_logging_service_v2.py +264 -69
  52. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/gapic/logging_v2/test_metrics_service_v2.py +265 -84
  53. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/handlers/__init__.py +0 -1
  54. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/handlers/middleware/test_request.py +1 -0
  55. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/handlers/test__helpers.py +9 -2
  56. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/handlers/test_app_engine.py +3 -1
  57. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/handlers/test_container_engine.py +3 -2
  58. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/handlers/test_handlers.py +12 -10
  59. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/handlers/test_structured_log.py +20 -18
  60. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/handlers/transports/test_background_thread.py +5 -4
  61. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/test__gapic.py +36 -18
  62. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/test__helpers.py +1 -4
  63. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/test__http.py +11 -12
  64. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/test__instrumentation.py +1 -0
  65. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/test_client.py +24 -21
  66. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/test_entries.py +26 -21
  67. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/test_logger.py +31 -18
  68. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/test_logging_shim.py +1 -2
  69. google_cloud_logging-3.13.0/PKG-INFO +0 -143
  70. google_cloud_logging-3.13.0/README.rst +0 -94
  71. google_cloud_logging-3.13.0/google_cloud_logging.egg-info/PKG-INFO +0 -143
  72. google_cloud_logging-3.13.0/tests/performance/noxfile.py +0 -175
  73. google_cloud_logging-3.13.0/tests/performance/test_performance.py +0 -348
  74. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/LICENSE +0 -0
  75. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/MANIFEST.in +0 -0
  76. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging/handlers/middleware/__init__.py +0 -0
  77. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging/handlers/transports/__init__.py +2 -2
  78. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging/py.typed +0 -0
  79. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/_http.py +2 -2
  80. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/gapic_metadata.json +0 -0
  81. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/handlers/_helpers.py +1 -1
  82. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/handlers/_monitored_resources.py +1 -1
  83. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/handlers/app_engine.py +0 -0
  84. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/handlers/container_engine.py +0 -0
  85. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/handlers/middleware/__init__.py +0 -0
  86. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/handlers/transports/__init__.py +2 -2
  87. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/handlers/transports/background_thread.py +0 -0
  88. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/handlers/transports/base.py +0 -0
  89. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/metric.py +0 -0
  90. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/py.typed +0 -0
  91. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/resource.py +0 -0
  92. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/__init__.py +0 -0
  93. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/config_service_v2/__init__.py +1 -1
  94. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/logging_service_v2/__init__.py +1 -1
  95. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/services/metrics_service_v2/__init__.py +1 -1
  96. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/sink.py +0 -0
  97. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google/cloud/logging_v2/types/__init__.py +3 -3
  98. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google_cloud_logging.egg-info/dependency_links.txt +0 -0
  99. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google_cloud_logging.egg-info/not-zip-safe +0 -0
  100. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/google_cloud_logging.egg-info/top_level.txt +0 -0
  101. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/setup.cfg +0 -0
  102. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/__init__.py +0 -0
  103. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/__init__.py +0 -0
  104. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/gapic/__init__.py +0 -0
  105. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/gapic/logging_v2/__init__.py +0 -0
  106. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/handlers/test__monitored_resources.py +9 -9
  107. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/handlers/transports/__init__.py +0 -0
  108. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/handlers/transports/test_base.py +0 -0
  109. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/handlers/transports/test_sync.py +2 -2
  110. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/test_metric.py +0 -0
  111. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/test_packaging.py +0 -0
  112. {google_cloud_logging-3.13.0 → google_cloud_logging-3.14.0}/tests/unit/test_sink.py +0 -0
@@ -0,0 +1,254 @@
1
+ Metadata-Version: 2.4
2
+ Name: google-cloud-logging
3
+ Version: 3.14.0
4
+ Summary: Google Cloud Logging API client library
5
+ Home-page: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-logging
6
+ Author: Google LLC
7
+ Author-email: googleapis-packages@google.com
8
+ License: Apache 2.0
9
+ Platform: Posix; MacOS X; Windows
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.7
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Operating System :: OS Independent
24
+ Classifier: Topic :: Internet
25
+ Requires-Python: >=3.7
26
+ License-File: LICENSE
27
+ Requires-Dist: google-api-core[grpc]!=2.0.*,!=2.1.*,!=2.10.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,<3.0.0,>=1.34.1
28
+ Requires-Dist: google-auth!=2.24.0,!=2.25.0,<3.0.0,>=2.14.1
29
+ Requires-Dist: google-cloud-appengine-logging<2.0.0,>=0.1.3
30
+ Requires-Dist: google-cloud-audit-log<1.0.0,>=0.3.1
31
+ Requires-Dist: google-cloud-core<3.0.0,>=2.0.0
32
+ Requires-Dist: grpc-google-iam-v1<1.0.0,>=0.12.4
33
+ Requires-Dist: opentelemetry-api>=1.9.0
34
+ Requires-Dist: grpcio<2.0.0,>=1.33.2
35
+ Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14"
36
+ Requires-Dist: proto-plus<2.0.0,>=1.22.3
37
+ Requires-Dist: proto-plus<2.0.0,>=1.25.0; python_version >= "3.13"
38
+ Requires-Dist: protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<7.0.0,>=3.20.2
39
+ Dynamic: author
40
+ Dynamic: author-email
41
+ Dynamic: classifier
42
+ Dynamic: description
43
+ Dynamic: home-page
44
+ Dynamic: license
45
+ Dynamic: license-file
46
+ Dynamic: platform
47
+ Dynamic: requires-dist
48
+ Dynamic: requires-python
49
+ Dynamic: summary
50
+
51
+ Python Client for Cloud Logging API
52
+ ===================================
53
+
54
+ |stable| |pypi| |versions|
55
+
56
+ `Cloud Logging API`_: Writes log entries and manages your Cloud Logging configuration.
57
+
58
+ - `Client Library Documentation`_
59
+ - `Product Documentation`_
60
+
61
+ .. |stable| image:: https://img.shields.io/badge/support-stable-gold.svg
62
+ :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#stability-levels
63
+ .. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-logging.svg
64
+ :target: https://pypi.org/project/google-cloud-logging/
65
+ .. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-logging.svg
66
+ :target: https://pypi.org/project/google-cloud-logging/
67
+ .. _Cloud Logging API: https://cloud.google.com/logging/docs
68
+ .. _Client Library Documentation: https://cloud.google.com/python/docs/reference/logging/latest/summary_overview
69
+ .. _Product Documentation: https://cloud.google.com/logging/docs
70
+
71
+ Quick Start
72
+ -----------
73
+
74
+ In order to use this library, you first need to go through the following steps:
75
+
76
+ 1. `Select or create a Cloud Platform project.`_
77
+ 2. `Enable billing for your project.`_
78
+ 3. `Enable the Cloud Logging API.`_
79
+ 4. `Set up Authentication.`_
80
+
81
+ .. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
82
+ .. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
83
+ .. _Enable the Cloud Logging API.: https://cloud.google.com/logging/docs
84
+ .. _Set up Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
85
+
86
+ For an interactive walkthrough on how to use this library in a python application, click the Guide Me button below:
87
+
88
+ |guide|
89
+
90
+ .. |guide| image:: https://raw.githubusercontent.com/googleapis/google-cloud-python/main/packages/google-cloud-logging/_static/guide-me.png
91
+ :target: https://console.cloud.google.com/?walkthrough_id=logging__logging-python
92
+
93
+ Installation
94
+ ~~~~~~~~~~~~
95
+
96
+ Install this library in a virtual environment using `venv`_. `venv`_ is a tool that
97
+ creates isolated Python environments. These isolated environments can have separate
98
+ versions of Python packages, which allows you to isolate one project's dependencies
99
+ from the dependencies of other projects.
100
+
101
+ With `venv`_, it's possible to install this library without needing system
102
+ install permissions, and without clashing with the installed system
103
+ dependencies.
104
+
105
+ .. _`venv`: https://docs.python.org/3/library/venv.html
106
+
107
+
108
+ Code samples and snippets
109
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
110
+
111
+ Code samples and snippets live in the `samples/`_ folder.
112
+
113
+ .. _samples/: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-logging/samples
114
+
115
+
116
+ Supported Python Versions
117
+ ^^^^^^^^^^^^^^^^^^^^^^^^^
118
+ Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of
119
+ Python.
120
+
121
+ Python >= 3.7, including 3.14
122
+
123
+ .. _active: https://devguide.python.org/devcycle/#in-development-main-branch
124
+ .. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches
125
+
126
+ Unsupported Python Versions
127
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
128
+ Python <= 3.6
129
+
130
+ If you are using an `end-of-life`_
131
+ version of Python, we recommend that you update as soon as possible to an actively supported version.
132
+
133
+ .. _end-of-life: https://devguide.python.org/devcycle/#end-of-life-branches
134
+
135
+ Mac/Linux
136
+ ^^^^^^^^^
137
+
138
+ .. code-block:: console
139
+
140
+ python3 -m venv <your-env>
141
+ source <your-env>/bin/activate
142
+ pip install google-cloud-logging
143
+
144
+
145
+ Windows
146
+ ^^^^^^^
147
+
148
+ .. code-block:: console
149
+
150
+ py -m venv <your-env>
151
+ .\<your-env>\Scripts\activate
152
+ pip install google-cloud-logging
153
+
154
+ Next Steps
155
+ ~~~~~~~~~~
156
+
157
+ - Read the `Client Library Documentation`_ for Cloud Logging API
158
+ to see other available methods on the client.
159
+ - Read the `Cloud Logging API Product documentation`_ to learn
160
+ more about the product and see How-to Guides.
161
+ - View this `README`_ to see the full list of Cloud
162
+ APIs that we cover.
163
+
164
+ .. _Cloud Logging API Product documentation: https://cloud.google.com/logging/docs
165
+ .. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst
166
+
167
+ Logging
168
+ -------
169
+
170
+ This library uses the standard Python :code:`logging` functionality to log some RPC events that could be of interest for debugging and monitoring purposes.
171
+ Note the following:
172
+
173
+ #. Logs may contain sensitive information. Take care to **restrict access to the logs** if they are saved, whether it be on local storage or on Google Cloud Logging.
174
+ #. Google may refine the occurrence, level, and content of various log messages in this library without flagging such changes as breaking. **Do not depend on immutability of the logging events**.
175
+ #. By default, the logging events from this library are not handled. You must **explicitly configure log handling** using one of the mechanisms below.
176
+
177
+ Simple, environment-based configuration
178
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
179
+
180
+ To enable logging for this library without any changes in your code, set the :code:`GOOGLE_SDK_PYTHON_LOGGING_SCOPE` environment variable to a valid Google
181
+ logging scope. This configures handling of logging events (at level :code:`logging.DEBUG` or higher) from this library in a default manner, emitting the logged
182
+ messages in a structured format. It does not currently allow customizing the logging levels captured nor the handlers, formatters, etc. used for any logging
183
+ event.
184
+
185
+ A logging scope is a period-separated namespace that begins with :code:`google`, identifying the Python module or package to log.
186
+
187
+ - Valid logging scopes: :code:`google`, :code:`google.cloud.asset.v1`, :code:`google.api`, :code:`google.auth`, etc.
188
+ - Invalid logging scopes: :code:`foo`, :code:`123`, etc.
189
+
190
+ **NOTE**: If the logging scope is invalid, the library does not set up any logging handlers.
191
+
192
+ Environment-Based Examples
193
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^
194
+
195
+ - Enabling the default handler for all Google-based loggers
196
+
197
+ .. code-block:: console
198
+
199
+ export GOOGLE_SDK_PYTHON_LOGGING_SCOPE=google
200
+
201
+ - Enabling the default handler for a specific Google module (for a client library called :code:`library_v1`):
202
+
203
+ .. code-block:: console
204
+
205
+ export GOOGLE_SDK_PYTHON_LOGGING_SCOPE=google.cloud.library_v1
206
+
207
+
208
+ Advanced, code-based configuration
209
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
210
+
211
+ You can also configure a valid logging scope using Python's standard `logging` mechanism.
212
+
213
+ Code-Based Examples
214
+ ^^^^^^^^^^^^^^^^^^^
215
+
216
+ - Configuring a handler for all Google-based loggers
217
+
218
+ .. code-block:: python
219
+
220
+ import logging
221
+
222
+ from google.cloud import library_v1
223
+
224
+ base_logger = logging.getLogger("google")
225
+ base_logger.addHandler(logging.StreamHandler())
226
+ base_logger.setLevel(logging.DEBUG)
227
+
228
+ - Configuring a handler for a specific Google module (for a client library called :code:`library_v1`):
229
+
230
+ .. code-block:: python
231
+
232
+ import logging
233
+
234
+ from google.cloud import library_v1
235
+
236
+ base_logger = logging.getLogger("google.cloud.library_v1")
237
+ base_logger.addHandler(logging.StreamHandler())
238
+ base_logger.setLevel(logging.DEBUG)
239
+
240
+ Logging details
241
+ ~~~~~~~~~~~~~~~
242
+
243
+ #. Regardless of which of the mechanisms above you use to configure logging for this library, by default logging events are not propagated up to the root
244
+ logger from the `google`-level logger. If you need the events to be propagated to the root logger, you must explicitly set
245
+ :code:`logging.getLogger("google").propagate = True` in your code.
246
+ #. You can mix the different logging configurations above for different Google modules. For example, you may want use a code-based logging configuration for
247
+ one library, but decide you need to also set up environment-based logging configuration for another library.
248
+
249
+ #. If you attempt to use both code-based and environment-based configuration for the same module, the environment-based configuration will be ineffectual
250
+ if the code -based configuration gets applied first.
251
+
252
+ #. The Google-specific logging configurations (default handlers for environment-based configuration; not propagating logging events to the root logger) get
253
+ executed the first time *any* client library is instantiated in your application, and only if the affected loggers have not been previously configured.
254
+ (This is the reason for 2.i. above.)
@@ -0,0 +1,204 @@
1
+ Python Client for Cloud Logging API
2
+ ===================================
3
+
4
+ |stable| |pypi| |versions|
5
+
6
+ `Cloud Logging API`_: Writes log entries and manages your Cloud Logging configuration.
7
+
8
+ - `Client Library Documentation`_
9
+ - `Product Documentation`_
10
+
11
+ .. |stable| image:: https://img.shields.io/badge/support-stable-gold.svg
12
+ :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#stability-levels
13
+ .. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-logging.svg
14
+ :target: https://pypi.org/project/google-cloud-logging/
15
+ .. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-logging.svg
16
+ :target: https://pypi.org/project/google-cloud-logging/
17
+ .. _Cloud Logging API: https://cloud.google.com/logging/docs
18
+ .. _Client Library Documentation: https://cloud.google.com/python/docs/reference/logging/latest/summary_overview
19
+ .. _Product Documentation: https://cloud.google.com/logging/docs
20
+
21
+ Quick Start
22
+ -----------
23
+
24
+ In order to use this library, you first need to go through the following steps:
25
+
26
+ 1. `Select or create a Cloud Platform project.`_
27
+ 2. `Enable billing for your project.`_
28
+ 3. `Enable the Cloud Logging API.`_
29
+ 4. `Set up Authentication.`_
30
+
31
+ .. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
32
+ .. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
33
+ .. _Enable the Cloud Logging API.: https://cloud.google.com/logging/docs
34
+ .. _Set up Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
35
+
36
+ For an interactive walkthrough on how to use this library in a python application, click the Guide Me button below:
37
+
38
+ |guide|
39
+
40
+ .. |guide| image:: https://raw.githubusercontent.com/googleapis/google-cloud-python/main/packages/google-cloud-logging/_static/guide-me.png
41
+ :target: https://console.cloud.google.com/?walkthrough_id=logging__logging-python
42
+
43
+ Installation
44
+ ~~~~~~~~~~~~
45
+
46
+ Install this library in a virtual environment using `venv`_. `venv`_ is a tool that
47
+ creates isolated Python environments. These isolated environments can have separate
48
+ versions of Python packages, which allows you to isolate one project's dependencies
49
+ from the dependencies of other projects.
50
+
51
+ With `venv`_, it's possible to install this library without needing system
52
+ install permissions, and without clashing with the installed system
53
+ dependencies.
54
+
55
+ .. _`venv`: https://docs.python.org/3/library/venv.html
56
+
57
+
58
+ Code samples and snippets
59
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
60
+
61
+ Code samples and snippets live in the `samples/`_ folder.
62
+
63
+ .. _samples/: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-logging/samples
64
+
65
+
66
+ Supported Python Versions
67
+ ^^^^^^^^^^^^^^^^^^^^^^^^^
68
+ Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of
69
+ Python.
70
+
71
+ Python >= 3.7, including 3.14
72
+
73
+ .. _active: https://devguide.python.org/devcycle/#in-development-main-branch
74
+ .. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches
75
+
76
+ Unsupported Python Versions
77
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
78
+ Python <= 3.6
79
+
80
+ If you are using an `end-of-life`_
81
+ version of Python, we recommend that you update as soon as possible to an actively supported version.
82
+
83
+ .. _end-of-life: https://devguide.python.org/devcycle/#end-of-life-branches
84
+
85
+ Mac/Linux
86
+ ^^^^^^^^^
87
+
88
+ .. code-block:: console
89
+
90
+ python3 -m venv <your-env>
91
+ source <your-env>/bin/activate
92
+ pip install google-cloud-logging
93
+
94
+
95
+ Windows
96
+ ^^^^^^^
97
+
98
+ .. code-block:: console
99
+
100
+ py -m venv <your-env>
101
+ .\<your-env>\Scripts\activate
102
+ pip install google-cloud-logging
103
+
104
+ Next Steps
105
+ ~~~~~~~~~~
106
+
107
+ - Read the `Client Library Documentation`_ for Cloud Logging API
108
+ to see other available methods on the client.
109
+ - Read the `Cloud Logging API Product documentation`_ to learn
110
+ more about the product and see How-to Guides.
111
+ - View this `README`_ to see the full list of Cloud
112
+ APIs that we cover.
113
+
114
+ .. _Cloud Logging API Product documentation: https://cloud.google.com/logging/docs
115
+ .. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst
116
+
117
+ Logging
118
+ -------
119
+
120
+ This library uses the standard Python :code:`logging` functionality to log some RPC events that could be of interest for debugging and monitoring purposes.
121
+ Note the following:
122
+
123
+ #. Logs may contain sensitive information. Take care to **restrict access to the logs** if they are saved, whether it be on local storage or on Google Cloud Logging.
124
+ #. Google may refine the occurrence, level, and content of various log messages in this library without flagging such changes as breaking. **Do not depend on immutability of the logging events**.
125
+ #. By default, the logging events from this library are not handled. You must **explicitly configure log handling** using one of the mechanisms below.
126
+
127
+ Simple, environment-based configuration
128
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
129
+
130
+ To enable logging for this library without any changes in your code, set the :code:`GOOGLE_SDK_PYTHON_LOGGING_SCOPE` environment variable to a valid Google
131
+ logging scope. This configures handling of logging events (at level :code:`logging.DEBUG` or higher) from this library in a default manner, emitting the logged
132
+ messages in a structured format. It does not currently allow customizing the logging levels captured nor the handlers, formatters, etc. used for any logging
133
+ event.
134
+
135
+ A logging scope is a period-separated namespace that begins with :code:`google`, identifying the Python module or package to log.
136
+
137
+ - Valid logging scopes: :code:`google`, :code:`google.cloud.asset.v1`, :code:`google.api`, :code:`google.auth`, etc.
138
+ - Invalid logging scopes: :code:`foo`, :code:`123`, etc.
139
+
140
+ **NOTE**: If the logging scope is invalid, the library does not set up any logging handlers.
141
+
142
+ Environment-Based Examples
143
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^
144
+
145
+ - Enabling the default handler for all Google-based loggers
146
+
147
+ .. code-block:: console
148
+
149
+ export GOOGLE_SDK_PYTHON_LOGGING_SCOPE=google
150
+
151
+ - Enabling the default handler for a specific Google module (for a client library called :code:`library_v1`):
152
+
153
+ .. code-block:: console
154
+
155
+ export GOOGLE_SDK_PYTHON_LOGGING_SCOPE=google.cloud.library_v1
156
+
157
+
158
+ Advanced, code-based configuration
159
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160
+
161
+ You can also configure a valid logging scope using Python's standard `logging` mechanism.
162
+
163
+ Code-Based Examples
164
+ ^^^^^^^^^^^^^^^^^^^
165
+
166
+ - Configuring a handler for all Google-based loggers
167
+
168
+ .. code-block:: python
169
+
170
+ import logging
171
+
172
+ from google.cloud import library_v1
173
+
174
+ base_logger = logging.getLogger("google")
175
+ base_logger.addHandler(logging.StreamHandler())
176
+ base_logger.setLevel(logging.DEBUG)
177
+
178
+ - Configuring a handler for a specific Google module (for a client library called :code:`library_v1`):
179
+
180
+ .. code-block:: python
181
+
182
+ import logging
183
+
184
+ from google.cloud import library_v1
185
+
186
+ base_logger = logging.getLogger("google.cloud.library_v1")
187
+ base_logger.addHandler(logging.StreamHandler())
188
+ base_logger.setLevel(logging.DEBUG)
189
+
190
+ Logging details
191
+ ~~~~~~~~~~~~~~~
192
+
193
+ #. Regardless of which of the mechanisms above you use to configure logging for this library, by default logging events are not propagated up to the root
194
+ logger from the `google`-level logger. If you need the events to be propagated to the root logger, you must explicitly set
195
+ :code:`logging.getLogger("google").propagate = True` in your code.
196
+ #. You can mix the different logging configurations above for different Google modules. For example, you may want use a code-based logging configuration for
197
+ one library, but decide you need to also set up environment-based logging configuration for another library.
198
+
199
+ #. If you attempt to use both code-based and environment-based configuration for the same module, the environment-based configuration will be ineffectual
200
+ if the code -based configuration gets applied first.
201
+
202
+ #. The Google-specific logging configurations (default handlers for environment-based configuration; not propagating logging events to the root logger) get
203
+ executed the first time *any* client library is instantiated in your application, and only if the affected loggers have not been previously configured.
204
+ (This is the reason for 2.i. above.)
@@ -1,6 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
-
3
- # Copyright 2020 Google LLC
2
+ # Copyright 2025 Google LLC
4
3
  #
5
4
  # Licensed under the Apache License, Version 2.0 (the "License");
6
5
  # you may not use this file except in compliance with the License.
@@ -14,24 +13,19 @@
14
13
  # See the License for the specific language governing permissions and
15
14
  # limitations under the License.
16
15
  #
17
-
18
- from google.cloud.logging_v2 import __version__
19
- from google.cloud.logging_v2 import ASCENDING
20
- from google.cloud.logging_v2 import DESCENDING
21
-
16
+ from google.cloud.logging_v2 import ASCENDING, DESCENDING, __version__, handlers, types
22
17
  from google.cloud.logging_v2.client import Client
23
- from google.cloud.logging_v2.entries import logger_name_from_path
24
- from google.cloud.logging_v2.entries import LogEntry
25
- from google.cloud.logging_v2.entries import TextEntry
26
- from google.cloud.logging_v2.entries import StructEntry
27
- from google.cloud.logging_v2.entries import ProtobufEntry
28
- from google.cloud.logging_v2 import handlers
29
- from google.cloud.logging_v2.logger import Logger
30
- from google.cloud.logging_v2.logger import Batch
18
+ from google.cloud.logging_v2.entries import (
19
+ LogEntry,
20
+ ProtobufEntry,
21
+ StructEntry,
22
+ TextEntry,
23
+ logger_name_from_path,
24
+ )
25
+ from google.cloud.logging_v2.logger import Batch, Logger
31
26
  from google.cloud.logging_v2.metric import Metric
32
27
  from google.cloud.logging_v2.resource import Resource
33
28
  from google.cloud.logging_v2.sink import Sink
34
- from google.cloud.logging_v2 import types
35
29
 
36
30
  __all__ = (
37
31
  "__version__",
@@ -13,4 +13,4 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- __version__ = "3.13.0" # {x-release-please-version}
16
+ __version__ = "3.14.0" # {x-release-please-version}
@@ -16,10 +16,12 @@
16
16
 
17
17
  from google.cloud.logging_v2.handlers.app_engine import AppEngineHandler
18
18
  from google.cloud.logging_v2.handlers.container_engine import ContainerEngineHandler
19
+ from google.cloud.logging_v2.handlers.handlers import (
20
+ CloudLoggingFilter,
21
+ CloudLoggingHandler,
22
+ setup_logging,
23
+ )
19
24
  from google.cloud.logging_v2.handlers.structured_log import StructuredLogHandler
20
- from google.cloud.logging_v2.handlers.handlers import CloudLoggingHandler
21
- from google.cloud.logging_v2.handlers.handlers import CloudLoggingFilter
22
- from google.cloud.logging_v2.handlers.handlers import setup_logging
23
25
 
24
26
  __all__ = [
25
27
  "AppEngineHandler",
@@ -1,37 +1,37 @@
1
- # Copyright 2018 Google LLC
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2025 Google LLC
2
3
  #
3
4
  # Licensed under the Apache License, Version 2.0 (the "License");
4
5
  # you may not use this file except in compliance with the License.
5
6
  # You may obtain a copy of the License at
6
7
  #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
+ # http://www.apache.org/licenses/LICENSE-2.0
8
9
  #
9
10
  # Unless required by applicable law or agreed to in writing, software
10
11
  # distributed under the License is distributed on an "AS IS" BASIS,
11
12
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
13
  # See the License for the specific language governing permissions and
13
14
  # limitations under the License.
14
-
15
+ #
15
16
  from __future__ import absolute_import
16
17
 
17
18
  from google.cloud.logging_v2 import gapic_version as package_version
18
19
 
19
20
  __version__ = package_version.__version__
20
21
 
22
+ from google.cloud.logging_v2 import handlers, types
21
23
  from google.cloud.logging_v2.client import Client
22
- from google.cloud.logging_v2.entries import logger_name_from_path
23
- from google.cloud.logging_v2.entries import LogEntry
24
- from google.cloud.logging_v2.entries import TextEntry
25
- from google.cloud.logging_v2.entries import StructEntry
26
- from google.cloud.logging_v2.entries import ProtobufEntry
27
- from google.cloud.logging_v2 import handlers
28
- from google.cloud.logging_v2.logger import Logger
29
- from google.cloud.logging_v2.logger import Batch
24
+ from google.cloud.logging_v2.entries import (
25
+ LogEntry,
26
+ ProtobufEntry,
27
+ StructEntry,
28
+ TextEntry,
29
+ logger_name_from_path,
30
+ )
31
+ from google.cloud.logging_v2.logger import Batch, Logger
30
32
  from google.cloud.logging_v2.metric import Metric
31
33
  from google.cloud.logging_v2.resource import Resource
32
34
  from google.cloud.logging_v2.sink import Sink
33
- from google.cloud.logging_v2 import types
34
-
35
35
 
36
36
  ASCENDING = "timestamp asc"
37
37
  """Query string to order by ascending timestamps."""
@@ -15,29 +15,26 @@
15
15
  """Wrapper for adapting the autogenerated gapic client to the hand-written
16
16
  client."""
17
17
 
18
+ from google.api_core import client_info, gapic_v1
19
+ from google.protobuf.json_format import MessageToDict, ParseDict, ParseError
20
+
21
+ from google.cloud.logging_v2._helpers import entry_from_resource
22
+ from google.cloud.logging_v2.metric import Metric
18
23
  from google.cloud.logging_v2.services.config_service_v2 import ConfigServiceV2Client
19
24
  from google.cloud.logging_v2.services.logging_service_v2 import LoggingServiceV2Client
20
25
  from google.cloud.logging_v2.services.metrics_service_v2 import MetricsServiceV2Client
21
- from google.cloud.logging_v2.types import CreateSinkRequest
22
- from google.cloud.logging_v2.types import UpdateSinkRequest
23
- from google.cloud.logging_v2.types import ListSinksRequest
24
- from google.cloud.logging_v2.types import ListLogMetricsRequest
25
- from google.cloud.logging_v2.types import ListLogEntriesRequest
26
- from google.cloud.logging_v2.types import WriteLogEntriesRequest
27
- from google.cloud.logging_v2.types import LogSink
28
- from google.cloud.logging_v2.types import LogMetric
29
- from google.cloud.logging_v2.types import LogEntry as LogEntryPB
30
-
31
- from google.protobuf.json_format import MessageToDict
32
- from google.protobuf.json_format import ParseDict
33
- from google.protobuf.json_format import ParseError
34
-
35
- from google.cloud.logging_v2._helpers import entry_from_resource
36
26
  from google.cloud.logging_v2.sink import Sink
37
- from google.cloud.logging_v2.metric import Metric
38
-
39
- from google.api_core import client_info
40
- from google.api_core import gapic_v1
27
+ from google.cloud.logging_v2.types import (
28
+ CreateSinkRequest,
29
+ ListLogEntriesRequest,
30
+ ListLogMetricsRequest,
31
+ ListSinksRequest,
32
+ LogMetric,
33
+ LogSink,
34
+ UpdateSinkRequest,
35
+ WriteLogEntriesRequest,
36
+ )
37
+ from google.cloud.logging_v2.types import LogEntry as LogEntryPB
41
38
 
42
39
 
43
40
  class _LoggingAPI(object):
@@ -15,17 +15,16 @@
15
15
  """Common logging helpers."""
16
16
 
17
17
  import logging
18
-
19
- from datetime import datetime
20
- from datetime import timedelta
21
- from datetime import timezone
18
+ from datetime import datetime, timedelta, timezone
22
19
 
23
20
  import requests
24
21
 
25
- from google.cloud.logging_v2.entries import LogEntry
26
- from google.cloud.logging_v2.entries import ProtobufEntry
27
- from google.cloud.logging_v2.entries import StructEntry
28
- from google.cloud.logging_v2.entries import TextEntry
22
+ from google.cloud.logging_v2.entries import (
23
+ LogEntry,
24
+ ProtobufEntry,
25
+ StructEntry,
26
+ TextEntry,
27
+ )
29
28
 
30
29
  try:
31
30
  from google.cloud.logging_v2.types import LogSeverity
@@ -13,8 +13,9 @@
13
13
  # limitations under the License.
14
14
 
15
15
  """Add diagnostic instrumentation source information to logs"""
16
- from google.cloud.logging_v2.entries import StructEntry
16
+
17
17
  from google.cloud.logging_v2 import __version__
18
+ from google.cloud.logging_v2.entries import StructEntry
18
19
 
19
20
  _DIAGNOSTIC_INFO_KEY = "logging.googleapis.com/diagnostic"
20
21
  _INSTRUMENTATION_SOURCE_KEY = "instrumentation_source"