Logging: Fix tests.#8273
Conversation
|
I think you need to also change the usage to |
|
Also, we need to figure out why #8227 passed CI here. |
|
@tseaver We forgot to add |
|
Looks like there's some more work to get tests passing again (after fixing the import) |
|
I don't understand the google-cloud-python/logging/google/cloud/logging/logger.py Lines 338 to 348 in c5acdad creating a which derives from which derives from google-cloud-python/logging/google/cloud/logging/entries.py Lines 67 to 87 in c5acdad which clearly takes a |
|
OK, the There will also be test failures due to the use of a def enqueue(
self, record, message, resource=None, labels=None, trace=None, span_id=None
):
"""Queues a log entry to be written by the background thread.
:type record: :class:`logging.LogRecord`
:param record: Python log record that the handler was called with.
:type message: str
:param message: The message from the ``LogRecord`` after being
formatted by the associated log formatters.
:type resource: :class:`~google.cloud.logging.resource.Resource`
:param resource: (Optional) Monitored resource of the entry
:type labels: dict
:param labels: (Optional) Mapping of labels for the entry.
:type trace: str
:param trace: (optional) traceid to apply to the logging entry.
:type span_id: str
:param span_id: (optional) span_id within the trace for the log entry.
Specify the trace parameter if span_id is set.
"""
self._queue.put_nowait(
{
"info": {"message": message, "python_logger": record.name},
"severity": record.levelname,
"resource": resource,
"labels": labels,
"trace": trace,
"span_id": span_id,
> "timestamp": datetime.datetime.utcfromtimestamp(record.created),
}
)
E TypeError: an integer is required (got type Mock) |
|
If this is going to take a long time to fix, would it make sense to roll back PR #8227 in the meantime? |
|
Fixes internal issue 134713268.