From 8a7857ba59aa6770e0b5e75d276fd353cf4fe7bb Mon Sep 17 00:00:00 2001 From: Dmytro Tretiakov Date: Wed, 26 Aug 2015 17:32:54 +0300 Subject: [PATCH] Patch updates loging for sandboxed apps. --- Sparkle/Autoupdate/Autoupdate.m | 2 +- Sparkle/SULog.m | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Sparkle/Autoupdate/Autoupdate.m b/Sparkle/Autoupdate/Autoupdate.m index b63f8135..7a1c72bb 100644 --- a/Sparkle/Autoupdate/Autoupdate.m +++ b/Sparkle/Autoupdate/Autoupdate.m @@ -232,7 +232,7 @@ int main(int __unused argc, const char __unused *argv[]) [connection setRootObject:appInstaller]; if (![connection registerName:[NSString stringWithFormat:@"Sparkle-%@", [NSBundle bundleWithPath:appInstaller.hostPath].bundleIdentifier]]) { - NSLog(@"%@ server: could not register server. Is one already running?\n", args.firstObject); + SULog(@"%@ server: could not register server. Is one already running?\n", args.firstObject); } [application setDelegate:appInstaller]; diff --git a/Sparkle/SULog.m b/Sparkle/SULog.m index 5941aac7..6526ec64 100644 --- a/Sparkle/SULog.m +++ b/Sparkle/SULog.m @@ -63,7 +63,11 @@ void SULog(NSString *format, ...) va_list ap; va_start(ap, format); NSString *theStr = [[NSString alloc] initWithFormat:format arguments:ap]; + va_end(ap); + +#ifdef DEBUG NSLog(@"Sparkle: %@", theStr); +#endif FILE *logfile = fopen([[SULogFilePath stringByExpandingTildeInPath] fileSystemRepresentation], "a"); if (logfile) { @@ -72,7 +76,6 @@ void SULog(NSString *format, ...) fwrite([theData bytes], 1, [theData length], logfile); fclose(logfile); } - va_end(ap); }