From 7e7c97a09f4bd9f23665964ec5a9c6db195810d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Wed, 18 Jan 2017 19:01:45 +0000 Subject: [PATCH 1/2] Use app-independent subsystem identifier --- Sparkle/SULog.m | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Sparkle/SULog.m b/Sparkle/SULog.m index 7b8125d6..b4969ba1 100644 --- a/Sparkle/SULog.m +++ b/Sparkle/SULog.m @@ -31,11 +31,8 @@ void SULog(SULogLevel level, NSString *format, ...) hasOSLogging = [SUOperatingSystem isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){10, 12, 0}]; - NSString *mainBundleIdentifier = mainBundle.bundleIdentifier; - NSString *bundleIdentifier = (mainBundleIdentifier != nil) ? mainBundleIdentifier : @""SPARKLE_BUNDLE_IDENTIFIER; - if (hasOSLogging) { - const char *subsystem = [[bundleIdentifier stringByAppendingString:@".Sparkle"] UTF8String]; + const char *subsystem = SPARKLE_BUNDLE_IDENTIFIER; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpartial-availability" // This creates a thread-safe object From c104c1b27ebebbc6cbd5933a9e913bb4e7812710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesin=CC=81ski?= Date: Wed, 18 Jan 2017 22:31:03 +0000 Subject: [PATCH 2/2] Fix facility identifier --- Sparkle/SULog.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sparkle/SULog.m b/Sparkle/SULog.m index b4969ba1..1e816b75 100644 --- a/Sparkle/SULog.m +++ b/Sparkle/SULog.m @@ -43,12 +43,12 @@ void SULog(SULogLevel level, NSString *format, ...) // Act the same way os_log() does; don't log to stderr if a terminal device is attached if (!isatty(STDERR_FILENO)) { options |= ASL_OPT_STDERR; - } + } NSString *displayName = [[NSFileManager defaultManager] displayNameAtPath:mainBundle.bundlePath]; - client = asl_open([displayName stringByAppendingString:@" [Sparkle]"].UTF8String, bundleIdentifier.UTF8String, options); + client = asl_open([displayName stringByAppendingString:@" [Sparkle]"].UTF8String, SPARKLE_BUNDLE_IDENTIFIER, options); queue = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL); -} + } }); if (!hasOSLogging && client == NULL) {