ConsoleLogExporter/LogRecord.to_json repr serialization #3427
matthew-mcallister
started this conversation in
General
Replies: 1 comment
-
Is it intuitive as to what |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I noticed that the
ConsoleLogExporter
class serializes severity numbers like follows:This is because the
LogRecord.to_json
serializes the number usingrepr(self.severity_number)
. Seeing a raw Python repr in the middle of a JSON object like that is a little jarring; wouldn't it make more sense to outputself.severity_number.value
instead? I.e.Since I'm on the subject, the same could be said about the
resource
log field. The output format is like this:I feel like this could be an actual JSON object? Like
Beta Was this translation helpful? Give feedback.
All reactions