Skip to content

Fix GoogleUtilities regression for Firestore builds 2 #2433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions GoogleUtilities/Logger/GULLogger.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#import "GULLoggerLevel.h"
#import "GULOSLogger.h"

#if TARGET_OS_IOS
#import <UIKit/UIKit.h>
#endif

static id<GULLoggerSystem> sGULLogger;

NSString *const kGULLoggerInvalidLoggerLevelCore = @"I-COR000023";
Expand Down
20 changes: 19 additions & 1 deletion GoogleUtilities/Logger/Private/GULOSLogger.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
#import "GULLogger+Internal.h"
#import "GULLoggerLevel.h"

#if TARGET_OS_IOS
#import <UIKit/UIKit.h>
#endif

NS_ASSUME_NONNULL_BEGIN

// Function which calls the macro so that this can be substituted for testing.
Expand All @@ -38,8 +42,14 @@ static void GULLOSLogWithType(os_log_t log, os_log_type_t type, char *s, ...) {
va_start(args, s);
#if TARGET_OS_TV
os_log_with_type(log, type, "%s", (char *)args);
#elif TARGET_OS_OSX
// Silence macOS 10.10 warning until we move minimum to 10.11.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability"
os_log_with_type(log, type, "%s", (char *)args);
#pragma clang diagnostic pop
#else
os_log_with_type(log, type, "%s", args);
os_log_with_type(log, type, "%s", args);
#endif
va_end(args);
} else {
Expand Down Expand Up @@ -169,7 +179,15 @@ - (void)logWithLevel:(GULLoggerLevel)level
#else
if ([[UIDevice currentDevice].systemVersion integerValue] >= 9) {
#endif
#if TARGET_OS_OSX
// Silence macOS 10.10 warning until we move minimum to 10.11.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability"
osLog = os_log_create(kGULLoggerClientFacilityName, service.UTF8String);
#pragma clang diagnostic pop
#else
osLog = os_log_create(kGULLoggerClientFacilityName, service.UTF8String);
#endif
self.categoryLoggers[service] = osLog;
} else {
#ifdef DEBUG
Expand Down
5 changes: 3 additions & 2 deletions scripts/if_changed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ else
;;

Firestore-xcodebuild|Firestore-pod-lib-lint)
check_changes '^(Firestore|FirebaseFirestore.podspec|FirebaseFirestoreSwift.podspec)'
check_changes '^(Firestore|FirebaseFirestore.podspec|FirebaseFirestoreSwift.podspec|'\
'GoogleUtilities)'
;;

Firestore-cmake)
check_changes '^(Firestore/(core|third_party)|cmake)'
check_changes '^(Firestore/(core|third_party)|cmake|GoogleUtilities)'
;;

*)
Expand Down