From 1eb6f2f92186e5e96247f4331cb387744be1c825 Mon Sep 17 00:00:00 2001 From: Pasin Suriyentrakorn Date: Fri, 31 Jan 2025 11:17:25 -0800 Subject: [PATCH] Fix LogSinks using wrong class initialize method (#3359) The class initialize method is + initialize instead of + init. --- Objective-C/CBLLog.mm | 2 +- Objective-C/Internal/CBLLogSinks+Internal.h | 2 +- Objective-C/LogSink/CBLLogSinks.mm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Objective-C/CBLLog.mm b/Objective-C/CBLLog.mm index defc5e14c..75ac8439d 100644 --- a/Objective-C/CBLLog.mm +++ b/Objective-C/CBLLog.mm @@ -51,7 +51,7 @@ - (instancetype) initWithDefault { self = [super init]; if (self) { // Initialize new logging system - [CBLLogSinks init]; + CBLAssertNotNil(CBLLogSinks.self); // Create console logger: _console = [[CBLConsoleLogger alloc] initWithDefault]; diff --git a/Objective-C/Internal/CBLLogSinks+Internal.h b/Objective-C/Internal/CBLLogSinks+Internal.h index 4a35b8882..7b9004f7d 100644 --- a/Objective-C/Internal/CBLLogSinks+Internal.h +++ b/Objective-C/Internal/CBLLogSinks+Internal.h @@ -39,7 +39,7 @@ typedef NS_ENUM(NSUInteger, CBLLogAPI) { + (void) writeCBLLog: (C4LogDomain)domain level: (C4LogLevel)level message: (NSString*)message; -+ (void) checkLogApiVersion: (id) source; ++ (void) checkLogApiVersion: (nullable id) source; @end diff --git a/Objective-C/LogSink/CBLLogSinks.mm b/Objective-C/LogSink/CBLLogSinks.mm index e99b5ce77..29732b7fc 100644 --- a/Objective-C/LogSink/CBLLogSinks.mm +++ b/Objective-C/LogSink/CBLLogSinks.mm @@ -50,7 +50,7 @@ @implementation CBLLogSinks static CBLLogAPI _vAPI; NSDictionary* domainDictionary = nil; -+ (void) init { ++ (void) initialize { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ // Cache log domain for logging from the platforms: