diff --git a/platform/darwin/src/native_apple_interface.m b/platform/darwin/src/native_apple_interface.m index 7547c7fb7..2262251e2 100644 --- a/platform/darwin/src/native_apple_interface.m +++ b/platform/darwin/src/native_apple_interface.m @@ -53,13 +53,21 @@ static MGLNativeNetworkManager *instance = nil; } - (void)debugLog:(NSString *)format, ... { - // TODO: Replace with existing mbgl logging handling. - [self.delegate debugLog:format]; + va_list formatList; + va_start(formatList, format); + NSString *formattedMessage = [[NSString alloc] initWithFormat:format arguments:formatList]; + va_end(formatList); + + [self.delegate debugLog:formattedMessage]; } - (void)errorLog:(NSString *)format, ... { - // TODO: Replace with existing mbgl logging handling. - [self.delegate errorLog:format]; + va_list formatList; + va_start(formatList, format); + NSString *formattedMessage = [[NSString alloc] initWithFormat:format arguments:formatList]; + va_end(formatList); + + [self.delegate errorLog:formattedMessage]; } @end diff --git a/platform/ios/platform/darwin/src/MGLNetworkConfiguration.mm b/platform/ios/platform/darwin/src/MGLNetworkConfiguration.mm index 77bf737d8..7826881ce 100644 --- a/platform/ios/platform/darwin/src/MGLNetworkConfiguration.mm +++ b/platform/ios/platform/darwin/src/MGLNetworkConfiguration.mm @@ -122,11 +122,21 @@ NSString * const kMGLDownloadPerformanceEvent = @"mobile.performance_trace"; } - (void)debugLog:(NSString *)format, ... { - MGLLogDebug(format); + va_list formatList; + va_start(formatList, format); + NSString *formattedMessage = [[NSString alloc] initWithFormat:format arguments:formatList]; + va_end(formatList); + + MGLLogDebug(formattedMessage); } - (void)errorLog:(NSString *)format, ... { - MGLLogError(format); + va_list formatList; + va_start(formatList, format); + NSString *formattedMessage = [[NSString alloc] initWithFormat:format arguments:formatList]; + va_end(formatList); + + MGLLogError(formattedMessage); } #pragma mark - Event management