summaryrefslogtreecommitdiff
path: root/indra/newview/llappdelegate-objc.mm
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2018-06-15 16:48:20 -0400
committerNat Goodspeed <nat@lindenlab.com>2018-06-15 16:48:20 -0400
commit448e82f39c472c82620bb52e0644e258b363d562 (patch)
tree9e72eae4aa32322768d2b0cd8fc20e9f06a11370 /indra/newview/llappdelegate-objc.mm
parentf26ba0f0eccce2e6b66554dc1132ff29e6d0f3b1 (diff)
SL-821: Try to add SecondLife.log file to Mac BugSplat crash report.
Introduce new header file llappviewermacosx-for-objc.h to publish for llappdelegate-objc.mm and other Objective-C++ consumers the free functions in llappviewermacosx.cpp they consume. These were never before declared in any header file. Apparently, to date, we've been trusting to luck that Objective-C++ will infer the correct signature from calls -- and that the calls are correct with respect to the function definitions. :-P This gives us a place to introduce a new getLogFilePathname() function to query LLDir. (We don't simply #include "lldir.h" because of the pervasive use of BOOL in viewer headers; BOOL means something very different in Objective-C++.)
Diffstat (limited to 'indra/newview/llappdelegate-objc.mm')
-rw-r--r--indra/newview/llappdelegate-objc.mm17
1 files changed, 11 insertions, 6 deletions
diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm
index 8e1ad169c9..ad5398721b 100644
--- a/indra/newview/llappdelegate-objc.mm
+++ b/indra/newview/llappdelegate-objc.mm
@@ -29,6 +29,7 @@
@import BugsplatMac;
#endif
#include "llwindowmacosx-objc.h"
+#include "llappviewermacosx-for-objc.h"
#include <Carbon/Carbon.h> // Used for Text Input Services ("Safe" API - it's supported)
@implementation LLAppDelegate
@@ -189,18 +190,22 @@
return true;
}
-#if 0 // defined(LL_BUGSPLAT)
+#if defined(LL_BUGSPLAT)
@implementation BugsplatStartupManagerDelegate
- (BugsplatAttachment *)attachmentForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager {
- NSURL *fileURL = [[NSBundle mainBundle] URLForResource:@"example" withExtension:@"json"];
- NSData *data = [NSData dataWithContentsOfURL:fileURL];
-
+ std::string logfile = getLogFilePathname();
+ NSString *ns_logfile = [NSString stringWithCString:logfile->c_str()
+ encoding:NSUTF8StringEncoding];
+ NSData *data = [NSData dataWithContentsOfFile:ns_logfile];
+
+ // Apologies for the hard-coded log-file basename, but I do not know the
+ // incantation for "$(basename "$logfile")" in this language.
BugsplatAttachment *attachment =
- [[BugsplatAttachment alloc] initWithFilename:@"example.json"
+ [[BugsplatAttachment alloc] initWithFilename:@"SecondLife.log"
attachmentData:data
- contentType:@"application/json"];
+ contentType:@"text/plain"];
return attachment;
}