Repository navigation
Include information from LogEvent.error in log output if present - #245
Conversation
| public init( | ||
| level: Logger.Level, | ||
| message: Logger.Message, | ||
| error: (any Error)?, |
There was a problem hiding this comment.
I'm assuming breaking changes are ok, since it's a beta release?
|
I didn't spend too much time thinking of a good output format for the error, so I'm happy to adjust if you have any suggestions. One alternative is to simply treat it as metadata, and use some sensible keys, eg. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #245 +/- ##
==========================================
+ Coverage 82.37% 82.47% +0.09%
==========================================
Files 29 29
Lines 891 896 +5
==========================================
+ Hits 734 739 +5
Misses 157 157
🚀 New features to boost your workflow:
|
fpseverino
left a comment
There was a problem hiding this comment.
LGTM, the placement of the ErrorFragment is correct IMO, I'm not too sure about the output format, but we can change that later without breaking API
Namespace error to test suite
0xTim
left a comment
There was a problem hiding this comment.
Error output should definitely go in metadata. Only static strings should be added to the actual message as those are what are queried so need to be the same
@0xTim would you mind clarifying your suggestion? Do you mean we should skip adding a |
|
@samuelmurray yep exactly. Having a separate |
|
@0xTim have you had time to look at my changes? Let me know if you have any other suggestions! |
|
@samuelmurray you might need to update the branch to trigger CI, I don't have permission to update the branch in the fork I think |
|
@0xTim I did a merge from main, let's see if that triggers a build |
In
swift-log, a user can attach an error object to a log entry, which is passed as-is to theLogHandlerfor it to serialise.ConsoleLogger, and the default fragment, is updated to use this property, serialising it as[ Fully.Qualified.Type: string representation ].Example:
Fixes #239