aboutsummaryrefslogtreecommitdiff
path: root/src/client/mac
diff options
context:
space:
mode:
authorSylvain Defresne <sdefresne@chromium.org>2019-11-12 17:05:12 +0100
committerSylvain Defresne <sdefresne@chromium.org>2019-11-12 16:17:19 +0000
commit792e6b2143bffd46c93e8f80c10d00d8289b8d73 (patch)
tree37958bed84b654f2785744569d0ea162094546da /src/client/mac
parentAdd fallthrough annotations on new C++ switches (diff)
downloadbreakpad-792e6b2143bffd46c93e8f80c10d00d8289b8d73.tar.xz
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 <mark@chromium.org>
Diffstat (limited to 'src/client/mac')
-rw-r--r--src/client/mac/sender/uploader.mm24
1 files 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 <fcntl.h>
+#include <stdio.h>
#import <sys/stat.h>
#include <TargetConditionals.h>
#import <unistd.h>
@@ -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];
}