-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add highlights summary to bug report attachment #124
base: master
Are you sure you want to change the base?
Conversation
@@ -103,6 +103,6 @@ typedef void (^ARKEmailBugReporterCustomPromptCompletionBlock)(ARKEmailBugReport | |||
@property (nonatomic) BOOL attachesViewHierarchyDescription; | |||
|
|||
/// Returns an attachment containing the log messages. Defaults to a plain text attachment containing each log message formatted using the bug reporter's `logFormatter`. | |||
- (nullable ARKBugReportAttachment *)attachmentForLogMessages:(nonnull NSArray<ARKLogMessage *> *)logMessages inLogStoreNamed:(nonnull NSString *)logStoreName; | |||
- (nullable ARKBugReportAttachment *)attachmentForLogMessages:(nonnull NSArray<ARKLogMessage *> *)logMessages inLogStoreNamed:(nonnull NSString *)logStoreName numberOfErrorsInHighlights:(NSInteger)numberOfErrorsInHighlights; |
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.
This is a breaking change for AardvarkMailUI. We could potentially work around this, but I think we should go ahead and call this a breaking change, since there will be other breaking changes to follow (in making the log store be treated like any other attachment in the email bug reporter).
@@ -107,11 +110,13 @@ public final class LogStoreAttachmentGenerator: NSObject { | |||
/// - parameter logMessages: The log messages to be included in the attachment. | |||
/// - parameter logFormatter: The formatter with which to format the log messages. | |||
/// - parameter logStoreName: The name of the log store from which the logs were collected. | |||
@objc(attachmentForLogMessages:usingLogFormatter:logStoreName:) | |||
/// - parameter numberOfErrorsInHighlights: The number of errors to include in the highlights for the log store. | |||
@objc(attachmentForLogMessages:usingLogFormatter:logStoreName:numberOfErrorsInHighlights:) |
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.
This is a breaking change for Aardvark. This one would be fairly easy to work around (by creating a separate method, rather than adding a parameter with a default value). I could go either way on this one.
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.
2¢ For such a small change, I think the workaround is preferable.
19faefe
to
81c7b23
Compare
81c7b23
to
6f50c48
Compare
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.
LGTM. A few comments
Sources/Aardvark/BugReporting/LogStoreAttachmentGenerator.swift
Outdated
Show resolved
Hide resolved
Sources/Aardvark/BugReporting/LogStoreAttachmentGenerator.swift
Outdated
Show resolved
Hide resolved
cb141a7
to
67020d5
Compare
67020d5
to
ea60180
Compare
@@ -124,10 +129,19 @@ public final class LogStoreAttachmentGenerator: NSObject { | |||
|
|||
let fileName = logsFileName(for: logStoreName, fileType: "txt") | |||
|
|||
let recentErrorSummary = logMessages | |||
.lazy |
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.
Um, I'll be lazy: is .lazy
doing anything here, given the isEmpty
call just below? (I don't know!)
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 think the lazy
still reduces work cause it at least keeps it from doing the map
past the prefix
. I'm not 100% sure though, I might be overestimating the power of lazy
. At the very least it doesn't seem to hurt anything.
Resolves #119