Skip to content

Commit 7941272

Browse files
authored
Get rid of more firebase::Log* calls, to help with objc initialization. (#822)
* Get rid of more firebase::Log* calls, to help with objc initialization. * Format code.
1 parent 8098bee commit 7941272

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

app/src/util_ios.mm

+18-10
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ void RunOnBackgroundThread(void (*function_ptr)(void *function_data), void *func
338338
// implements a stub for the method).
339339
const char *type_encoding =
340340
method_getTypeEncoding(class_getInstanceMethod(type_encoding_class, name));
341-
FIREBASE_ASSERT(type_encoding);
341+
assert(type_encoding);
342342

343343
NSString *new_method_name_nsstring = nil;
344344
if (GetLogLevel() <= kLogLevelDebug) {
@@ -397,7 +397,9 @@ void RunOnBackgroundThread(void (*function_ptr)(void *function_data), void *func
397397
selector_implementation_names_per_selector_[selector_name_nsstring];
398398
const char *class_name = class_getName(clazz);
399399
if (!selector_implementation_names) {
400-
firebase::LogDebug("Method not cached for class %s selector %s.", class_name, selector_name);
400+
if (GetLogLevel() <= kLogLevelDebug) {
401+
NSLog(@"Method not cached for class %s selector %s.", class_name, selector_name);
402+
}
401403
return nil;
402404
}
403405

@@ -415,23 +417,29 @@ void RunOnBackgroundThread(void (*function_ptr)(void *function_data), void *func
415417
search_class = clazz;
416418
for (; search_class; search_class = class_getSuperclass(search_class)) {
417419
const char *search_class_name = class_getName(search_class);
418-
firebase::LogDebug("Searching for selector %s (%s) on class %s", selector_name,
419-
selector_implementation_name, search_class_name);
420+
if (GetLogLevel() <= kLogLevelDebug) {
421+
NSLog(@"Searching for selector %s (%s) on class %s", selector_name,
422+
selector_implementation_name, search_class_name);
423+
}
420424
Method method = class_getInstanceMethod(search_class, selector_implementation);
421425
method_implementation = method ? method_getImplementation(method) : nil;
422426
if (method_implementation) break;
423427
}
424428
if (method_implementation) break;
425429
}
426430
if (!method_implementation) {
427-
firebase::LogDebug("Class %s does not respond to selector %s (%s)", class_name, selector_name,
428-
selector_implementation_name_nsstring.UTF8String);
431+
if (GetLogLevel() <= kLogLevelDebug) {
432+
NSLog(@"Class %s does not respond to selector %s (%s)", class_name, selector_name,
433+
selector_implementation_name_nsstring.UTF8String);
434+
}
429435
return nil;
430436
}
431-
firebase::LogDebug("Found %s (%s, 0x%08x) on class %s (%s)", selector_name,
432-
selector_implementation_name_nsstring.UTF8String,
433-
static_cast<int>(reinterpret_cast<intptr_t>(method_implementation)),
434-
class_name, class_getName(search_class));
437+
if (GetLogLevel() <= kLogLevelDebug) {
438+
NSLog(@"Found %s (%s, 0x%08x) on class %s (%s)", selector_name,
439+
selector_implementation_name_nsstring.UTF8String,
440+
static_cast<int>(reinterpret_cast<intptr_t>(method_implementation)), class_name,
441+
class_getName(search_class));
442+
}
435443
return method_implementation;
436444
}
437445

0 commit comments

Comments
 (0)