fix(ios): logging format strings (#266)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user