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
ConsoleLogExporterclass serializes severity numbers like follows:This is because the
LogRecord.to_jsonserializes 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.valueinstead? I.e.Since I'm on the subject, the same could be said about the
resourcelog 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