-
Notifications
You must be signed in to change notification settings - Fork 133
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
RUMM-2735 Add methods to pass error info to logs as decomposed strings #1051
Conversation
3519e91
to
3873751
Compare
Sources/Datadog/Logger.swift
Outdated
/// - stackTrace: a string representation of the error's stack trace | ||
/// - attributes: a dictionary of attributes (optional) to add for this message. If an attribute with | ||
/// the same key already exist in this logger, it will be overridden (only for this message). | ||
func log(level: LogLevel, message: String, errorKind: String?, errorMessage: String?, |
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.
Is there a reason for us to not create an object conforming to Error
on Flutter's side as use the existing API?
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.
🤔 I hadn't thought about that (it wasn't possible in Android)
The reasons I can think not to are based on the strings that are created here:
init(error: Error) { |
If I create an NSError, I'll "{Domain} - {Code}" as the type, whereas with anything conforming to Error I'll just get the Swift type, which will always be the same (maybe not an issue as Obfuscation breaks getting the error type anyway).
I think this way gives us a lot more precision and allows Flutter / RN to specify the full object.
8ca1bbe
to
1a27200
Compare
Datadog ReportBranch report: ❄️ New Flaky Tests (2)
|
This is mostly for Cross Platform SDKs that need to send in serialized error information.
Co-authored-by: Pedro Lousada <pedro.lousada@datadoghq.com>
1a27200
to
f9738c2
Compare
What and why?
Adding methods to loggers so we can pass in error information (kind, message, and stack trace) as Strings instead of relying on the
Error
type from Swift.This is mostly for Cross Platform SDKs that need to send in serialized error information.
Review checklist
Custom CI job configuration (optional)