google-cloud-logging 3.11.3__tar.gz → 3.11.4__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 (109) hide show
  1. {google_cloud_logging-3.11.3/google_cloud_logging.egg-info → google_cloud_logging-3.11.4}/PKG-INFO +2 -1
  2. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging/gapic_version.py +1 -1
  3. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/_gapic.py +5 -1
  4. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/gapic_version.py +1 -1
  5. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/logger.py +42 -3
  6. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4/google_cloud_logging.egg-info}/PKG-INFO +2 -1
  7. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google_cloud_logging.egg-info/requires.txt +3 -0
  8. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/setup.py +1 -0
  9. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/test__gapic.py +17 -0
  10. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/LICENSE +0 -0
  11. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/MANIFEST.in +0 -0
  12. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/README.rst +0 -0
  13. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging/__init__.py +0 -0
  14. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging/handlers/__init__.py +0 -0
  15. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging/handlers/middleware/__init__.py +0 -0
  16. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging/handlers/transports/__init__.py +0 -0
  17. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging/py.typed +0 -0
  18. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/__init__.py +0 -0
  19. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/_helpers.py +0 -0
  20. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/_http.py +0 -0
  21. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/_instrumentation.py +0 -0
  22. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/client.py +0 -0
  23. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/entries.py +0 -0
  24. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/gapic_metadata.json +0 -0
  25. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/handlers/__init__.py +0 -0
  26. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/handlers/_helpers.py +0 -0
  27. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/handlers/_monitored_resources.py +0 -0
  28. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/handlers/app_engine.py +0 -0
  29. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/handlers/container_engine.py +0 -0
  30. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/handlers/handlers.py +0 -0
  31. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/handlers/middleware/__init__.py +0 -0
  32. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/handlers/middleware/request.py +0 -0
  33. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/handlers/structured_log.py +0 -0
  34. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/handlers/transports/__init__.py +0 -0
  35. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/handlers/transports/background_thread.py +0 -0
  36. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/handlers/transports/base.py +0 -0
  37. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/handlers/transports/sync.py +0 -0
  38. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/metric.py +0 -0
  39. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/py.typed +0 -0
  40. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/resource.py +0 -0
  41. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/__init__.py +0 -0
  42. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/config_service_v2/__init__.py +0 -0
  43. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/config_service_v2/async_client.py +0 -0
  44. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/config_service_v2/client.py +0 -0
  45. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/config_service_v2/pagers.py +0 -0
  46. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/config_service_v2/transports/__init__.py +0 -0
  47. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/config_service_v2/transports/base.py +0 -0
  48. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/config_service_v2/transports/grpc.py +0 -0
  49. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/config_service_v2/transports/grpc_asyncio.py +0 -0
  50. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/logging_service_v2/__init__.py +0 -0
  51. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/logging_service_v2/async_client.py +0 -0
  52. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/logging_service_v2/client.py +0 -0
  53. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/logging_service_v2/pagers.py +0 -0
  54. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/logging_service_v2/transports/__init__.py +0 -0
  55. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/logging_service_v2/transports/base.py +0 -0
  56. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/logging_service_v2/transports/grpc.py +0 -0
  57. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/logging_service_v2/transports/grpc_asyncio.py +0 -0
  58. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/metrics_service_v2/__init__.py +0 -0
  59. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/metrics_service_v2/async_client.py +0 -0
  60. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/metrics_service_v2/client.py +0 -0
  61. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/metrics_service_v2/pagers.py +0 -0
  62. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/metrics_service_v2/transports/__init__.py +0 -0
  63. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/metrics_service_v2/transports/base.py +0 -0
  64. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/metrics_service_v2/transports/grpc.py +0 -0
  65. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/services/metrics_service_v2/transports/grpc_asyncio.py +0 -0
  66. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/sink.py +0 -0
  67. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/types/__init__.py +0 -0
  68. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/types/log_entry.py +0 -0
  69. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/types/logging.py +0 -0
  70. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/types/logging_config.py +0 -0
  71. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google/cloud/logging_v2/types/logging_metrics.py +0 -0
  72. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google_cloud_logging.egg-info/SOURCES.txt +0 -0
  73. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google_cloud_logging.egg-info/dependency_links.txt +0 -0
  74. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google_cloud_logging.egg-info/not-zip-safe +0 -0
  75. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/google_cloud_logging.egg-info/top_level.txt +0 -0
  76. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/setup.cfg +0 -0
  77. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/__init__.py +0 -0
  78. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/performance/noxfile.py +0 -0
  79. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/performance/test_performance.py +0 -0
  80. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/system/gapic/v2/test_system_logging_service_v2_v2.py +0 -0
  81. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/system/test_system.py +0 -0
  82. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/__init__.py +0 -0
  83. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/gapic/__init__.py +0 -0
  84. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/gapic/logging_v2/__init__.py +0 -0
  85. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/gapic/logging_v2/test_config_service_v2.py +0 -0
  86. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/gapic/logging_v2/test_logging_service_v2.py +0 -0
  87. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/gapic/logging_v2/test_metrics_service_v2.py +0 -0
  88. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/handlers/__init__.py +0 -0
  89. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/handlers/middleware/test_request.py +0 -0
  90. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/handlers/test__helpers.py +0 -0
  91. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/handlers/test__monitored_resources.py +0 -0
  92. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/handlers/test_app_engine.py +0 -0
  93. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/handlers/test_container_engine.py +0 -0
  94. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/handlers/test_handlers.py +0 -0
  95. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/handlers/test_structured_log.py +0 -0
  96. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/handlers/transports/__init__.py +0 -0
  97. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/handlers/transports/test_background_thread.py +0 -0
  98. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/handlers/transports/test_base.py +0 -0
  99. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/handlers/transports/test_sync.py +0 -0
  100. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/test__helpers.py +0 -0
  101. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/test__http.py +0 -0
  102. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/test__instrumentation.py +0 -0
  103. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/test_client.py +0 -0
  104. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/test_entries.py +0 -0
  105. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/test_logger.py +0 -0
  106. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/test_logging_shim.py +0 -0
  107. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/test_metric.py +0 -0
  108. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/test_packaging.py +0 -0
  109. {google_cloud_logging-3.11.3 → google_cloud_logging-3.11.4}/tests/unit/test_sink.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: google-cloud-logging
3
- Version: 3.11.3
3
+ Version: 3.11.4
4
4
  Summary: Stackdriver Logging API client library
5
5
  Home-page: https://github.com/googleapis/python-logging
6
6
  Author: Google LLC
@@ -31,6 +31,7 @@ Requires-Dist: grpc-google-iam-v1<1.0.0dev,>=0.12.4
31
31
  Requires-Dist: opentelemetry-api>=1.9.0
32
32
  Requires-Dist: proto-plus<2.0.0dev,>=1.22.0
33
33
  Requires-Dist: proto-plus<2.0.0dev,>=1.22.2; python_version >= "3.11"
34
+ Requires-Dist: proto-plus<2.0.0dev,>=1.25.0; python_version >= "3.13"
34
35
  Requires-Dist: protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<6.0.0dev,>=3.20.2
35
36
 
36
37
  Python Client for Cloud Logging
@@ -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.11.3" # {x-release-please-version}
16
+ __version__ = "3.11.4" # {x-release-please-version}
@@ -30,6 +30,7 @@ from google.cloud.logging_v2.types import LogEntry as LogEntryPB
30
30
 
31
31
  from google.protobuf.json_format import MessageToDict
32
32
  from google.protobuf.json_format import ParseDict
33
+ from google.protobuf.json_format import ParseError
33
34
 
34
35
  from google.cloud.logging_v2._helpers import entry_from_resource
35
36
  from google.cloud.logging_v2.sink import Sink
@@ -151,7 +152,10 @@ class _LoggingAPI(object):
151
152
  Useful for checking whether the logging API endpoints are working
152
153
  properly before sending valuable data.
153
154
  """
154
- log_entry_pbs = [_log_entry_mapping_to_pb(entry) for entry in entries]
155
+ try:
156
+ log_entry_pbs = [_log_entry_mapping_to_pb(entry) for entry in entries]
157
+ except ParseError as e:
158
+ raise ValueError(f"Invalid log entry: {str(e)}") from e
155
159
 
156
160
  request = WriteLogEntriesRequest(
157
161
  log_name=logger_name,
@@ -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.11.3" # {x-release-please-version}
16
+ __version__ = "3.11.4" # {x-release-please-version}
@@ -162,6 +162,7 @@ class Logger(object):
162
162
 
163
163
  api_repr = entry.to_api_repr()
164
164
  entries = [api_repr]
165
+
165
166
  if google.cloud.logging_v2._instrumentation_emitted is False:
166
167
  entries = _add_instrumentation(entries, **kw)
167
168
  google.cloud.logging_v2._instrumentation_emitted = True
@@ -200,18 +201,38 @@ class Logger(object):
200
201
  self._do_log(client, TextEntry, text, **kw)
201
202
 
202
203
  def log_struct(self, info, *, client=None, **kw):
203
- """Log a dictionary message
204
+ """Logs a dictionary message.
204
205
 
205
206
  See
206
207
  https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/write
207
208
 
209
+ The message must be able to be serializable to a Protobuf Struct.
210
+ It must be a dictionary of strings to one of the following:
211
+
212
+ - :class:`str`
213
+ - :class:`int`
214
+ - :class:`float`
215
+ - :class:`bool`
216
+ - :class:`list[str|float|int|bool|list|dict|None]`
217
+ - :class:`dict[str, str|float|int|bool|list|dict|None]`
218
+
219
+ For more details on Protobuf structs, see https://protobuf.dev/reference/protobuf/google.protobuf/#value.
220
+ If the provided dictionary cannot be serialized into a Protobuf struct,
221
+ it will not be logged, and a :class:`ValueError` will be raised.
222
+
208
223
  Args:
209
- info (dict): the log entry information
224
+ info (dict[str, str|float|int|bool|list|dict|None]):
225
+ the log entry information.
210
226
  client (Optional[~logging_v2.client.Client]):
211
227
  The client to use. If not passed, falls back to the
212
228
  ``client`` stored on the current sink.
213
229
  kw (Optional[dict]): additional keyword arguments for the entry.
214
230
  See :class:`~logging_v2.entries.LogEntry`.
231
+
232
+ Raises:
233
+ ValueError:
234
+ if the dictionary message provided cannot be serialized into a Protobuf
235
+ struct.
215
236
  """
216
237
  for field in _STRUCT_EXTRACTABLE_FIELDS:
217
238
  # attempt to copy relevant fields from the payload into the LogEntry body
@@ -405,8 +426,22 @@ class Batch(object):
405
426
  def log_struct(self, info, **kw):
406
427
  """Add a struct entry to be logged during :meth:`commit`.
407
428
 
429
+ The message must be able to be serializable to a Protobuf Struct.
430
+ It must be a dictionary of strings to one of the following:
431
+
432
+ - :class:`str`
433
+ - :class:`int`
434
+ - :class:`float`
435
+ - :class:`bool`
436
+ - :class:`list[str|float|int|bool|list|dict|None]`
437
+ - :class:`dict[str, str|float|int|bool|list|dict|None]`
438
+
439
+ For more details on Protobuf structs, see https://protobuf.dev/reference/protobuf/google.protobuf/#value.
440
+ If the provided dictionary cannot be serialized into a Protobuf struct,
441
+ it will not be logged, and a :class:`ValueError` will be raised during :meth:`commit`.
442
+
408
443
  Args:
409
- info (dict): The struct entry,
444
+ info (dict[str, str|float|int|bool|list|dict|None]): The struct entry,
410
445
  kw (Optional[dict]): Additional keyword arguments for the entry.
411
446
  See :class:`~logging_v2.entries.LogEntry`.
412
447
  """
@@ -451,6 +486,10 @@ class Batch(object):
451
486
  Whether a batch's valid entries should be written even
452
487
  if some other entry failed due to a permanent error such
453
488
  as INVALID_ARGUMENT or PERMISSION_DENIED.
489
+
490
+ Raises:
491
+ ValueError:
492
+ if one of the messages in the batch cannot be successfully parsed.
454
493
  """
455
494
  if client is None:
456
495
  client = self.client
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: google-cloud-logging
3
- Version: 3.11.3
3
+ Version: 3.11.4
4
4
  Summary: Stackdriver Logging API client library
5
5
  Home-page: https://github.com/googleapis/python-logging
6
6
  Author: Google LLC
@@ -31,6 +31,7 @@ Requires-Dist: grpc-google-iam-v1<1.0.0dev,>=0.12.4
31
31
  Requires-Dist: opentelemetry-api>=1.9.0
32
32
  Requires-Dist: proto-plus<2.0.0dev,>=1.22.0
33
33
  Requires-Dist: proto-plus<2.0.0dev,>=1.22.2; python_version >= "3.11"
34
+ Requires-Dist: proto-plus<2.0.0dev,>=1.25.0; python_version >= "3.13"
34
35
  Requires-Dist: protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<6.0.0dev,>=3.20.2
35
36
 
36
37
  Python Client for Cloud Logging
@@ -10,3 +10,6 @@ protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<6.0.0dev,>=3.20.2
10
10
 
11
11
  [:python_version >= "3.11"]
12
12
  proto-plus<2.0.0dev,>=1.22.2
13
+
14
+ [:python_version >= "3.13"]
15
+ proto-plus<2.0.0dev,>=1.25.0
@@ -47,6 +47,7 @@ dependencies = [
47
47
  "opentelemetry-api >= 1.9.0",
48
48
  "proto-plus >= 1.22.0, <2.0.0dev",
49
49
  "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'",
50
+ "proto-plus >= 1.25.0, <2.0.0dev; python_version>='3.13'",
50
51
  "protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
51
52
  ]
52
53
  url = "https://github.com/googleapis/python-logging"
@@ -17,6 +17,8 @@ import unittest
17
17
  import google.auth.credentials
18
18
  import mock
19
19
 
20
+ from datetime import datetime
21
+
20
22
  import google.cloud.logging
21
23
  from google.cloud import logging_v2
22
24
  from google.cloud.logging_v2 import _gapic
@@ -173,6 +175,21 @@ class Test_LoggingAPI(unittest.TestCase):
173
175
  assert request.entries[0].resource.type == entry["resource"]["type"]
174
176
  assert request.entries[0].text_payload == "text"
175
177
 
178
+ def test_write_entries_parse_error(self):
179
+ client = self.make_logging_api()
180
+ with self.assertRaises(ValueError):
181
+ with mock.patch.object(
182
+ type(client._gapic_api.transport.write_log_entries), "__call__"
183
+ ) as call:
184
+ entry = {
185
+ "logName": self.LOG_PATH,
186
+ "resource": {"type": "global"},
187
+ "jsonPayload": {"time": datetime.now()},
188
+ }
189
+ client.write_entries([entry])
190
+
191
+ call.assert_not_called()
192
+
176
193
  def test_logger_delete(self):
177
194
  client = self.make_logging_api()
178
195