Add trace to logentry types#5878
Add trace to logentry types#5878tseaver merged 4 commits intogoogleapis:masterfrom salrashid123:add-logging-trace-option
Conversation
| @@ -251,16 +261,20 @@ def log_struct(self, info, client=None, labels=None, insert_id=None, | |||
|
|
|||
| :type timestamp: :class:`datetime.datetime` | |||
| :param timestamp: (optional) timestamp of event being logged. | |||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| logger.log_text(TEXT, client=client2, labels=LABELS, | ||
| insert_id=IID, severity=SEVERITY, http_request=REQUEST) | ||
| insert_id=IID, severity=SEVERITY, http_request=REQUEST, | ||
| trace=TRACE) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| if timestamp is not None: | ||
| info['timestamp'] = _datetime_to_rfc3339(timestamp) | ||
| if trace is not None: | ||
| info['trace'] = trace |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| :type timestamp: :class:`datetime.datetime` | ||
| :param timestamp: (optional) timestamp of event being logged. | ||
|
|
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| :param resource: (Optional) Monitored resource of the entry | ||
|
|
||
| :type trace: str | ||
| :param trace: (optional) traceid to apply to the entry. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
logging/tests/unit/test_logger.py
Outdated
| self.assertEqual(api._write_entries_called_with, | ||
| (ENTRIES, None, None, None)) | ||
|
|
||
| def test_log_text_w_unicode_explicit_client_labels_severity_httpreq_trace(self): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| if timestamp is not None: | ||
| info['timestamp'] = _datetime_to_rfc3339(timestamp) | ||
| if trace is not None: | ||
| info['trace'] = trace |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@dpebot Please merge when green. |
|
Okay! I'll merge when all statuses are green and all reviewers approve. |
Add traceID parameter for logentries:
#5505