e1.11.0 Configuration refactored and simplified (interface changed).

This commit is contained in:
2025-07-16 03:27:41 -04:00
parent 91b9961228
commit 09ef19bc9e
10 changed files with 170 additions and 482 deletions

View File

@ -364,24 +364,18 @@ func (s *serializer) serializeStructuredJSON(flags int64, timestamp time.Time, l
s.buf = append(s.buf, `"message":"`...)
s.writeString(message)
s.buf = append(s.buf, '"')
needsComma = true
// // Add trace if present
// if trace != "" {
// if needsComma {
// s.buf = append(s.buf, ',')
// }
// s.buf = append(s.buf, `"trace":"`...)
// s.writeString(trace)
// s.buf = append(s.buf, '"')
// needsComma = true
// }
// Add trace if present
if trace != "" {
s.buf = append(s.buf, ',')
s.buf = append(s.buf, `"trace":"`...)
s.writeString(trace)
s.buf = append(s.buf, '"')
}
// Marshal fields using encoding/json
if len(fields) > 0 {
if needsComma {
s.buf = append(s.buf, ',')
}
s.buf = append(s.buf, ',')
s.buf = append(s.buf, `"fields":`...)
// Use json.Marshal for proper encoding