Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix double conversion of datetime for log entries. #3144

Merged

Conversation

daspecster
Copy link
Contributor

Fixes: #3129

This should fix the double conversion issue.

/cc @waprin

@daspecster daspecster added the api: logging Issues related to the Cloud Logging API. label Mar 15, 2017
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 15, 2017
@@ -412,7 +412,7 @@ def test_write_entries_w_extra_properties(self):
'severity': SEVERITY,
'labels': LABELS,
'insertId': IID,
'timestamp': NOW,
'timestamp': NOW.strftime("%Y-%m-%dT%H:%M:%S.%fZ"),

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -412,7 +412,7 @@ def test_write_entries_w_extra_properties(self):
'severity': SEVERITY,
'labels': LABELS,
'insertId': IID,
'timestamp': NOW,
'timestamp': NOW.strftime("%Y-%m-%dT%H:%M:%S.%fZ"),

This comment was marked as spam.

{'textPayload': TEXT, 'insertId': IID1, 'timestamp': TIMESTAMP1},
{'jsonPayload': STRUCT, 'insertId': IID2, 'timestamp': TIMESTAMP2},
{'textPayload': TEXT, 'insertId': IID1,
'timestamp': TIMESTAMP1.strftime("%Y-%m-%dT%H:%M:%S.%fZ")},

This comment was marked as spam.

entries = _list_entries(logger)
self.assertEqual(len(entries), 1)
self.assertEqual(entries[0].payload, text_payload)
# self.assertEqual(entries[0].timestamp, now)

This comment was marked as spam.

@daspecster
Copy link
Contributor Author

@tseaver updated!

@daspecster daspecster merged commit 97379fc into googleapis:master Mar 16, 2017
@daspecster
Copy link
Contributor Author

Gah..forgot to squash...apologies.

@daspecster daspecster deleted the fix-logging-datetime-conversion branch March 16, 2017 20:08
@Fkawala
Copy link

Fkawala commented Mar 17, 2017

@daspecster thanks for the swift fix !

@daspecster
Copy link
Contributor Author

@Fkawala thanks for tracking it down!

richkadel pushed a commit to richkadel/google-cloud-python that referenced this pull request May 6, 2017
…me-conversion

Fix double conversion of datetime for log entries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the Cloud Logging API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug, double conversion.
7 participants