Commit b945006
authored
Logging: add support for additional 'LogEntry' fields (#6229)
Use namedtuples to reduce boilerplate in 'logger.Batch', 'logger.Logger', and 'entries' implementations: remove 'entry_type' and 'PAYLOAD_KEY' warts, dispatching instead based on class to load / save payload.
Parse 'LogEntry.receiveTimestamp' -> 'received_timestamp' attr. Make 'received_timestamp' default to 'None' for all instances. It is set only when parsing a server response.
Add support for 'LogEntry.traceSampled' field.
Add support for 'source_location' field of log entries.
Add support for 'operation' field of log entries.
Add 'ProtobufEntry.payload_json': Returns 'None' if the payload is a protobuf message. 'ProtobufEntry.payload_pb' now returns 'None' if the payload is *not* a protobuf message.
Drop 'EmptyEntry': just use 'LogEntry'.
Closes #5601.
Closes #6094.1 parent 4a8d52a commit b945006
File tree
8 files changed
+1272
-886
lines changed- docs
- google/cloud/logging
- tests
- system
- unit
8 files changed
+1272
-886
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
0 commit comments