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); }