From 6e790fc27d22e80527789cf8e783be6c90a23505 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Mon, 18 Jun 2018 16:38:49 -0400
Subject: [PATCH] SL-821: Add logging in the macOS BugSplat attachment
 override.

---
 indra/newview/llappdelegate-objc.mm        | 4 ++++
 indra/newview/llappviewermacosx-for-objc.h | 1 +
 indra/newview/llappviewermacosx.cpp        | 5 +++++
 3 files changed, 10 insertions(+)

diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm
index 11a4b5d48e9..2c2302ecfb3 100644
--- a/indra/newview/llappdelegate-objc.mm
+++ b/indra/newview/llappdelegate-objc.mm
@@ -202,9 +202,12 @@
 
 - (BugsplatAttachment *)attachmentForBugsplatStartupManager:(BugsplatStartupManager *)bugsplatStartupManager {
     std::string logfile = getLogFilePathname();
+    infos("Reached attachmentForBugsplatStartupManager with:");
+    infos(logfile);
     NSString *ns_logfile = [NSString stringWithCString:logfile.c_str()
                                               encoding:NSUTF8StringEncoding];
     NSData *data = [NSData dataWithContentsOfFile:ns_logfile];
+    infos("Read logfile");
 
     // Apologies for the hard-coded log-file basename, but I do not know the
     // incantation for "$(basename "$logfile")" in this language.
@@ -212,6 +215,7 @@
         [[BugsplatAttachment alloc] initWithFilename:@"SecondLife.log"
                                       attachmentData:data
                                          contentType:@"text/plain"];
+    infos("returning attachment");
     return attachment;
 }
 
diff --git a/indra/newview/llappviewermacosx-for-objc.h b/indra/newview/llappviewermacosx-for-objc.h
index ef5d90bfefd..e45cb85861f 100644
--- a/indra/newview/llappviewermacosx-for-objc.h
+++ b/indra/newview/llappviewermacosx-for-objc.h
@@ -30,5 +30,6 @@ bool pumpMainLoop();
 void handleQuit();
 void cleanupViewer();
 std::string getLogFilePathname();
+void infos(const std::string& message);
 
 #endif /* ! defined(LL_LLAPPVIEWERMACOSX_FOR_OBJC_H) */
diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp
index cdbdb23d9a8..562e7ebfde8 100644
--- a/indra/newview/llappviewermacosx.cpp
+++ b/indra/newview/llappviewermacosx.cpp
@@ -153,6 +153,11 @@ std::string getLogFilePathname()
     return gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log");
 }
 
+void infos(const std::string& message)
+{
+    LL_INFOS() << message << LL_ENDL;
+}
+
 int main( int argc, char **argv ) 
 {
 	// Store off the command line args for use later.
-- 
GitLab