Skip to content

Commit

Permalink
Logging: Add omitempty to other non-required fields
Browse files Browse the repository at this point in the history
  • Loading branch information
loafoe committed Aug 24, 2023
1 parent e99aff1 commit 9cbd82b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package internal

const (
LibraryVersion = "0.81.2"
LibraryVersion = "0.81.3"
)
36 changes: 18 additions & 18 deletions logging/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ type Element struct {

// Resource is a logging resource
type Resource struct {
ResourceType string `json:"resourceType"` // LogEvent
ID string `json:"id"` // 7f4c85a8-e472-479f-b772-2916353d02a4
ApplicationName string `json:"applicationName"` // OPS
EventID string `json:"eventId"` // 110114
Category string `json:"category"` // TRACELOG
Component string `json:"component"` // "TEST"
TransactionID string `json:"transactionId"` // 2abd7355-cbdd-43e1-b32a-43ec19cd98f0
ServiceName string `json:"serviceName,omitempty"` // OPS
ApplicationInstance string `json:"applicationInstance"` // INST-00002
ApplicationVersion string `json:"applicationVersion"` // 1.0.0
OriginatingUser string `json:"originatingUser"` // SomeUser
ServerName string `json:"serverName"` // app.example.com
LogTime string `json:"logTime"` // 2017-01-31T08:00:00Z
Severity string `json:"severity"` // INFO
TraceID string `json:"traceId,omitempty"` // xxx
SpanID string `json:"spanId,omitempty"` // yyy
LogData LogData `json:"logData"` // Log data
Custom json.RawMessage `json:"custom,omitempty"` // Custom log fields
ResourceType string `json:"resourceType"` // LogEvent
ID string `json:"id"` // 7f4c85a8-e472-479f-b772-2916353d02a4
ApplicationName string `json:"applicationName,omitempty"` // OPS
EventID string `json:"eventId"` // 110114
Category string `json:"category,omitempty"` // TRACELOG
Component string `json:"component,omitempty"` // "TEST"
TransactionID string `json:"transactionId"` // 2abd7355-cbdd-43e1-b32a-43ec19cd98f0
ServiceName string `json:"serviceName,omitempty"` // OPS
ApplicationInstance string `json:"applicationInstance,omitempty"` // INST-00002
ApplicationVersion string `json:"applicationVersion,omitempty"` // 1.0.0
OriginatingUser string `json:"originatingUser,omitempty"` // SomeUser
ServerName string `json:"serverName,omitempty"` // app.example.com
LogTime string `json:"logTime"` // 2017-01-31T08:00:00Z
Severity string `json:"severity"` // INFO
TraceID string `json:"traceId,omitempty"` // xxx
SpanID string `json:"spanId,omitempty"` // yyy
LogData LogData `json:"logData"` // Log data
Custom json.RawMessage `json:"custom,omitempty"` // Custom log fields
Meta map[string]interface{} `json:"-"`
Error error `json:"-"`
}
Expand Down

0 comments on commit 9cbd82b

Please sign in to comment.