diff --git a/Sparkle/SULog.m b/Sparkle/SULog.m index 3def222c..5941aac7 100644 --- a/Sparkle/SULog.m +++ b/Sparkle/SULog.m @@ -37,6 +37,7 @@ void SUClearLog(void) FILE *logfile = fopen([[SULogFilePath stringByExpandingTildeInPath] fileSystemRepresentation], "w"); if (logfile) { fclose(logfile); + SULog(@"===== %@ =====", [[NSFileManager defaultManager] displayNameAtPath:[[NSBundle mainBundle] bundlePath]]); } } @@ -53,6 +54,12 @@ void SUClearLog(void) void SULog(NSString *format, ...) { + static BOOL loggedYet = NO; + if (!loggedYet) { + loggedYet = YES; + SUClearLog(); + } + va_list ap; va_start(ap, format); NSString *theStr = [[NSString alloc] initWithFormat:format arguments:ap]; diff --git a/Sparkle/SUUpdater.m b/Sparkle/SUUpdater.m index 612ee52b..1aada864 100644 --- a/Sparkle/SUUpdater.m +++ b/Sparkle/SUUpdater.m @@ -332,9 +332,6 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults if ([self updateInProgress]) { return; } if (self.checkTimer) { [self.checkTimer invalidate]; self.checkTimer = nil; } // Timer is non-repeating, may have invalidated itself, so we had to retain it. - SUClearLog(); - SULog(@"===== %@ =====", [[NSFileManager defaultManager] displayNameAtPath:[[NSBundle mainBundle] bundlePath]]); - [self willChangeValueForKey:@"lastUpdateCheckDate"]; [self.host setObject:[NSDate date] forUserDefaultsKey:SULastCheckTimeKey]; [self didChangeValueForKey:@"lastUpdateCheckDate"];