-
Notifications
You must be signed in to change notification settings - Fork 56
feat: support AuditLog and RequestLog protos #274
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
Changes from all commits
5c8bd7e
b15b20e
f389c33
7a75fca
646f717
06cf4f5
549566e
fc36053
568bfcf
05f3283
83e3111
5ce683f
dc90e72
66d9c62
afddbf9
25c39df
2aa35ca
2d89fa1
2c8e136
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -503,6 +503,20 @@ def test_to_api_repr_defaults(self): | |
} | ||
self.assertEqual(entry.to_api_repr(), expected) | ||
|
||
def test_to_api_repr_struct(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please, no abbreviations in test or other method names There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "to_api_repr" is an existing function that we can't change here without breaking the API. We could add this to the list for v3.0.0 7522 changes (but it may not be worth the user confusion) |
||
from google.protobuf.struct_pb2 import Struct, Value | ||
from google.cloud.logging_v2.logger import _GLOBAL_RESOURCE | ||
|
||
LOG_NAME = "struct.log" | ||
message = Struct(fields={"foo": Value(bool_value=True)}) | ||
entry = self._make_one(log_name=LOG_NAME, payload=message) | ||
expected = { | ||
"logName": LOG_NAME, | ||
"jsonPayload": message, | ||
"resource": _GLOBAL_RESOURCE._to_dict(), | ||
} | ||
self.assertEqual(entry.to_api_repr(), expected) | ||
|
||
def test_to_api_repr_explicit(self): | ||
import datetime | ||
from google.cloud.logging import Resource | ||
|
Uh oh!
There was an error while loading. Please reload this page.