From 792e6b2143bffd46c93e8f80c10d00d8289b8d73 Mon Sep 17 00:00:00 2001 From: Sylvain Defresne Date: Tue, 12 Nov 2019 17:05:12 +0100 Subject: Remove dependency of uploader.mm on GTMLogger The file GTMLogger shipped with breakpad is a copy of the version from google_toolbox_for_mac. Having uploader.mm depend on GTMLogger causes pain to iOS projects that want to integrate both breakpad and google_toolbox_for_mac. Since the file uploader.mm mixed uses of fprintf and GTMLogger to log errors and warning, convert it to only use fprintf to stderr. Bug: none Change-Id: I68313ccf6951676a2859f44225281813722096ba Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1911755 Reviewed-by: Mark Mentovai --- src/client/mac/sender/uploader.mm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/client/mac/sender/uploader.mm b/src/client/mac/sender/uploader.mm index 08aecf76..13b6130a 100644 --- a/src/client/mac/sender/uploader.mm +++ b/src/client/mac/sender/uploader.mm @@ -28,6 +28,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #import +#include #import #include #import @@ -38,7 +39,6 @@ #import "client/apple/Framework/BreakpadDefines.h" #import "client/mac/sender/uploader.h" -#import "common/mac/GTMLogger.h" const int kMinidumpFileLengthLimit = 2 * 1024 * 1024; // 2MB @@ -89,17 +89,15 @@ NSData *readData(int fileId, ssize_t length) { NSDictionary *readConfigurationData(const char *configFile) { int fileId = open(configFile, O_RDONLY, 0600); if (fileId == -1) { - GTMLoggerDebug(@"Couldn't open config file %s - %s", - configFile, - strerror(errno)); + fprintf(stderr, "Breakpad Uploader: Couldn't open config file %s - %s", + configFile, strerror(errno)); } // we want to avoid a build-up of old config files even if they // have been incorrectly written by the framework if (unlink(configFile)) { - GTMLoggerDebug(@"Couldn't unlink config file %s - %s", - configFile, - strerror(errno)); + fprintf(stderr, "Breakpad Uploader: Couldn't unlink config file %s - %s", + configFile, strerror(errno)); } if (fileId == -1) { @@ -360,7 +358,8 @@ NSDictionary *readConfigurationData(const char *configFile) { NSString *logTarFile = [NSString stringWithFormat:@"%s/log.tar.bz2",tmpDir]; logFileData_ = [[NSData alloc] initWithContentsOfFile:logTarFile]; if (logFileData_ == nil) { - GTMLoggerDebug(@"Cannot find temp tar log file: %@", logTarFile); + fprintf(stderr, "Breakpad Uploader: Cannot find temp tar log file: %s", + [logTarFile UTF8String]); return NO; } return YES; @@ -529,13 +528,14 @@ NSDictionary *readConfigurationData(const char *configFile) { const char *dest = [destString fileSystemRepresentation]; if (rename(src, dest) == 0) { - GTMLoggerInfo(@"Breakpad Uploader: Renamed %s to %s after successful " \ - "upload",src, dest); + fprintf(stderr, + "Breakpad Uploader: Renamed %s to %s after successful upload", src, + dest); } else { // can't rename - don't worry - it's not important for users - GTMLoggerDebug(@"Breakpad Uploader: successful upload report ID = %s\n", - reportID ); + fprintf(stderr, "Breakpad Uploader: successful upload report ID = %s\n", + reportID); } [result release]; } -- cgit v1.2.1