Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
OpenTracing Semantic Conventions uses error.object (#179)
Browse files Browse the repository at this point in the history
The OpenTracing Specification suggests "error.object" as the log
key for an error object.

Fixes #164

Co-authored-by: Rahman Syed <rahman.syed@gmail.com>
  • Loading branch information
rahmansyed and Rahman Syed authored Apr 8, 2020
1 parent 2876d20 commit 0dfafac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions log/field.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ func Float64(key string, val float64) Field {
}
}

// Error adds an error with the key "error" to a Span.LogFields() record
// Error adds an error with the key "error.object" to a Span.LogFields() record
func Error(err error) Field {
return Field{
key: "error",
key: "error.object",
fieldType: errorType,
interfaceVal: err,
}
Expand Down
4 changes: 2 additions & 2 deletions log/field_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ func TestFieldString(t *testing.T) {
},
{
field: Error(fmt.Errorf("err msg")),
expected: "error:err msg",
expected: "error.object:err msg",
},
{
field: Error(nil),
expected: "error:<nil>",
expected: "error.object:<nil>",
},
{
field: Noop(),
Expand Down

0 comments on commit 0dfafac

Please sign in to comment.