-
Notifications
You must be signed in to change notification settings - Fork 241
Modify log API #1046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modify log API #1046
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1046 +/- ##
========================================
Coverage 86.86% 86.87%
========================================
Files 55 55
Lines 5840 5950 +110
========================================
+ Hits 5073 5169 +96
- Misses 624 638 +14
Partials 143 143 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvements, LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good change!
log.go
Outdated
} | ||
if user.Email != "" { | ||
attrs["user.email"] = Attribute{Value: user.Email, Type: "string"} | ||
attrs["user.email"] = Attribute{Value: user.Email, Type: AttributeString} | ||
} | ||
} | ||
} | ||
if spanID.String() != "0000000000000000" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can this even happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is no propagation context, then the spanID would be empty. So just emitting it in that case.
Closes #1042. See issue for more details.
Description
Modifying existing API to make usage clearer. Introducing chaining of attributes:
Trace
,Debug
,Info
,Warn
,Error
,Panic
,Fatal
that return aLogEntry
LogEntry
, to setString
,Int
, ...Example: