mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Add some more info to log message to more easily classify them
This commit is contained in:
@@ -359,7 +359,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ([_crashFiles count] > 0) {
|
if ([_crashFiles count] > 0) {
|
||||||
BITHockeyLog(@"%i pending crash reports found.", [_crashFiles count]);
|
BITHockeyLog(@"INFO: %i pending crash reports found.", [_crashFiles count]);
|
||||||
return YES;
|
return YES;
|
||||||
} else
|
} else
|
||||||
return NO;
|
return NO;
|
||||||
@@ -370,7 +370,7 @@
|
|||||||
|
|
||||||
// slightly delayed startup processing, so we don't keep the first runloop on startup busy for too long
|
// slightly delayed startup processing, so we don't keep the first runloop on startup busy for too long
|
||||||
- (void)invokeDelayedProcessing {
|
- (void)invokeDelayedProcessing {
|
||||||
BITHockeyLog(@"Start delayed CrashManager processing");
|
BITHockeyLog(@"INFO: Start delayed CrashManager processing");
|
||||||
|
|
||||||
if (!_sendingInProgress && [self hasPendingCrashReport]) {
|
if (!_sendingInProgress && [self hasPendingCrashReport]) {
|
||||||
_sendingInProgress = YES;
|
_sendingInProgress = YES;
|
||||||
@@ -478,7 +478,7 @@
|
|||||||
PLCrashReport *report = [[[PLCrashReport alloc] initWithData:crashData error:&error] autorelease];
|
PLCrashReport *report = [[[PLCrashReport alloc] initWithData:crashData error:&error] autorelease];
|
||||||
|
|
||||||
if (report == nil) {
|
if (report == nil) {
|
||||||
BITHockeyLog(@"Could not parse crash report");
|
BITHockeyLog(@"WARNING: Could not parse crash report");
|
||||||
// we cannot do anything with this report, so delete it
|
// we cannot do anything with this report, so delete it
|
||||||
[_fileManager removeItemAtPath:filename error:&error];
|
[_fileManager removeItemAtPath:filename error:&error];
|
||||||
[_fileManager removeItemAtPath:[NSString stringWithFormat:@"%@.meta", filename] error:&error];
|
[_fileManager removeItemAtPath:[NSString stringWithFormat:@"%@.meta", filename] error:&error];
|
||||||
@@ -553,7 +553,7 @@
|
|||||||
[self saveSettings];
|
[self saveSettings];
|
||||||
|
|
||||||
if (crashes != nil) {
|
if (crashes != nil) {
|
||||||
BITHockeyLog(@"Sending crash reports:\n%@", crashes);
|
BITHockeyLog(@"INFO: Sending crash reports:\n%@", crashes);
|
||||||
[self postXML:[NSString stringWithFormat:@"<crashes>%@</crashes>", crashes]];
|
[self postXML:[NSString stringWithFormat:@"<crashes>%@</crashes>", crashes]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -632,14 +632,14 @@
|
|||||||
_urlConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
|
_urlConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
|
||||||
|
|
||||||
if (!_urlConnection) {
|
if (!_urlConnection) {
|
||||||
BITHockeyLog(@"Sending crash reports could not start!");
|
BITHockeyLog(@"INFO: Sending crash reports could not start!");
|
||||||
_sendingInProgress = NO;
|
_sendingInProgress = NO;
|
||||||
} else {
|
} else {
|
||||||
if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashManagerWillSendCrashReport:)]) {
|
if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashManagerWillSendCrashReport:)]) {
|
||||||
[self.delegate crashManagerWillSendCrashReport:self];
|
[self.delegate crashManagerWillSendCrashReport:self];
|
||||||
}
|
}
|
||||||
|
|
||||||
BITHockeyLog(@"Sending crash reports started.");
|
BITHockeyLog(@"INFO: Sending crash reports started.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -681,7 +681,7 @@
|
|||||||
mutabilityOption:NSPropertyListMutableContainersAndLeaves
|
mutabilityOption:NSPropertyListMutableContainersAndLeaves
|
||||||
format:nil
|
format:nil
|
||||||
errorDescription:NULL];
|
errorDescription:NULL];
|
||||||
BITHockeyLog(@"Received API response: %@", response);
|
BITHockeyLog(@"INFO: Received API response: %@", response);
|
||||||
|
|
||||||
if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashManagerDidFinishSendingCrashReport:)]) {
|
if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashManagerDidFinishSendingCrashReport:)]) {
|
||||||
[self.delegate crashManagerDidFinishSendingCrashReport:self];
|
[self.delegate crashManagerDidFinishSendingCrashReport:self];
|
||||||
|
|||||||
@@ -131,12 +131,12 @@
|
|||||||
- (void)startManager {
|
- (void)startManager {
|
||||||
if (!_validAppIdentifier) return;
|
if (!_validAppIdentifier) return;
|
||||||
|
|
||||||
BITHockeyLog(@"Starting HockeyManager");
|
BITHockeyLog(@"INFO: Starting HockeyManager");
|
||||||
_startManagerIsInvoked = YES;
|
_startManagerIsInvoked = YES;
|
||||||
|
|
||||||
// start CrashManager
|
// start CrashManager
|
||||||
if (![self isCrashManagerDisabled]) {
|
if (![self isCrashManagerDisabled]) {
|
||||||
BITHockeyLog(@"Start CrashManager");
|
BITHockeyLog(@"INFO: Start CrashManager");
|
||||||
if (_updateURL) {
|
if (_updateURL) {
|
||||||
[_crashManager setUpdateURL:_updateURL];
|
[_crashManager setUpdateURL:_updateURL];
|
||||||
}
|
}
|
||||||
@@ -145,7 +145,7 @@
|
|||||||
|
|
||||||
// Setup UpdateManager
|
// Setup UpdateManager
|
||||||
if (![self isUpdateManagerDisabled]) {
|
if (![self isUpdateManagerDisabled]) {
|
||||||
BITHockeyLog(@"Start UpdateManager with small delay");
|
BITHockeyLog(@"INFO: Start UpdateManager with small delay");
|
||||||
if (_updateURL) {
|
if (_updateURL) {
|
||||||
[_updateManager setUpdateURL:_updateURL];
|
[_updateManager setUpdateURL:_updateURL];
|
||||||
}
|
}
|
||||||
@@ -195,17 +195,17 @@
|
|||||||
_startManagerIsInvoked = NO;
|
_startManagerIsInvoked = NO;
|
||||||
|
|
||||||
if (_validAppIdentifier) {
|
if (_validAppIdentifier) {
|
||||||
BITHockeyLog(@"Setup CrashManager");
|
BITHockeyLog(@"INFO: Setup CrashManager");
|
||||||
_crashManager = [[BITCrashManager alloc] initWithAppIdentifier:_appIdentifier];
|
_crashManager = [[BITCrashManager alloc] initWithAppIdentifier:_appIdentifier];
|
||||||
_crashManager.delegate = _delegate;
|
_crashManager.delegate = _delegate;
|
||||||
|
|
||||||
BITHockeyLog(@"Setup UpdateManager");
|
BITHockeyLog(@"INFO: Setup UpdateManager");
|
||||||
_updateManager = [[BITUpdateManager alloc] initWithAppIdentifier:_appIdentifier isAppStoreEnvironemt:_appStoreEnvironment];
|
_updateManager = [[BITUpdateManager alloc] initWithAppIdentifier:_appIdentifier isAppStoreEnvironemt:_appStoreEnvironment];
|
||||||
_updateManager.delegate = _delegate;
|
_updateManager.delegate = _delegate;
|
||||||
|
|
||||||
// Only if JMC is part of the project
|
// Only if JMC is part of the project
|
||||||
if ([[self class] isJMCPresent]) {
|
if ([[self class] isJMCPresent]) {
|
||||||
BITHockeyLog(@"Setup JMC");
|
BITHockeyLog(@"INFO: Setup JMC");
|
||||||
[_updateManager setCheckForTracker:YES];
|
[_updateManager setCheckForTracker:YES];
|
||||||
[_updateManager addObserver:self forKeyPath:@"trackerConfig" options:0 context:nil];
|
[_updateManager addObserver:self forKeyPath:@"trackerConfig" options:0 context:nil];
|
||||||
[[self class] disableJMCCrashReporter];
|
[[self class] disableJMCCrashReporter];
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
#pragma mark - private
|
#pragma mark - private
|
||||||
|
|
||||||
- (void)reportError:(NSError *)error {
|
- (void)reportError:(NSError *)error {
|
||||||
BITHockeyLog(@"Error: %@", [error localizedDescription]);
|
BITHockeyLog(@"ERROR: %@", [error localizedDescription]);
|
||||||
_lastCheckFailed = YES;
|
_lastCheckFailed = YES;
|
||||||
|
|
||||||
// only show error if we enable that
|
// only show error if we enable that
|
||||||
@@ -310,7 +310,7 @@
|
|||||||
if ([UIWindow instancesRespondToSelector:@selector(rootViewController)]) {
|
if ([UIWindow instancesRespondToSelector:@selector(rootViewController)]) {
|
||||||
if ([window rootViewController]) {
|
if ([window rootViewController]) {
|
||||||
visibleWindow = window;
|
visibleWindow = window;
|
||||||
BITHockeyLog(@"UIWindow with rootViewController found: %@", visibleWindow);
|
BITHockeyLog(@"INFO: UIWindow with rootViewController found: %@", visibleWindow);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -433,7 +433,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_currentHockeyViewController) {
|
if (_currentHockeyViewController) {
|
||||||
BITHockeyLog(@"update view already visible, aborting");
|
BITHockeyLog(@"INFO: Update view already visible, aborting");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -698,7 +698,7 @@
|
|||||||
|
|
||||||
// build request & send
|
// build request & send
|
||||||
NSString *url = [NSString stringWithFormat:@"%@%@", _updateURL, parameter];
|
NSString *url = [NSString stringWithFormat:@"%@%@", _updateURL, parameter];
|
||||||
BITHockeyLog(@"sending api request to %@", url);
|
BITHockeyLog(@"INFO: Sending api request to %@", url);
|
||||||
|
|
||||||
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:1 timeoutInterval:10.0];
|
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:1 timeoutInterval:10.0];
|
||||||
[request setHTTPMethod:@"GET"];
|
[request setHTTPMethod:@"GET"];
|
||||||
@@ -722,7 +722,7 @@
|
|||||||
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Server returned empty response.", NSLocalizedDescriptionKey, nil]]];
|
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Server returned empty response.", NSLocalizedDescriptionKey, nil]]];
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
BITHockeyLog(@"Received API response: %@", responseString);
|
BITHockeyLog(@"INFO: Received API response: %@", responseString);
|
||||||
NSString *token = [[feedDict objectForKey:@"authcode"] lowercaseString];
|
NSString *token = [[feedDict objectForKey:@"authcode"] lowercaseString];
|
||||||
failed = NO;
|
failed = NO;
|
||||||
if ([[self authenticationToken] compare:token] == NSOrderedSame) {
|
if ([[self authenticationToken] compare:token] == NSOrderedSame) {
|
||||||
@@ -742,7 +742,7 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// different token, block this version
|
// different token, block this version
|
||||||
BITHockeyLog(@"AUTH FAILURE: %@", [self authenticationToken]);
|
BITHockeyLog(@"INFO: AUTH FAILURE: %@", [self authenticationToken]);
|
||||||
|
|
||||||
// store the new data
|
// store the new data
|
||||||
[[NSUserDefaults standardUserDefaults] setObject:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"] forKey:kBITUpdateAuthorizedVersion];
|
[[NSUserDefaults standardUserDefaults] setObject:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"] forKey:kBITUpdateAuthorizedVersion];
|
||||||
@@ -780,7 +780,7 @@
|
|||||||
|
|
||||||
// do we need to update?
|
// do we need to update?
|
||||||
if (![self shouldCheckForUpdates] && !_currentHockeyViewController) {
|
if (![self shouldCheckForUpdates] && !_currentHockeyViewController) {
|
||||||
BITHockeyLog(@"update not needed right now");
|
BITHockeyLog(@"INFO: Update not needed right now");
|
||||||
self.checkInProgress = NO;
|
self.checkInProgress = NO;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -810,7 +810,7 @@
|
|||||||
|
|
||||||
// build request & send
|
// build request & send
|
||||||
NSString *url = [NSString stringWithFormat:@"%@%@", _updateURL, parameter];
|
NSString *url = [NSString stringWithFormat:@"%@%@", _updateURL, parameter];
|
||||||
BITHockeyLog(@"sending api request to %@", url);
|
BITHockeyLog(@"INFO: Sending api request to %@", url);
|
||||||
|
|
||||||
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:1 timeoutInterval:10.0];
|
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:1 timeoutInterval:10.0];
|
||||||
[request setHTTPMethod:@"GET"];
|
[request setHTTPMethod:@"GET"];
|
||||||
@@ -830,7 +830,7 @@
|
|||||||
if (_isAppStoreEnvironment) return NO;
|
if (_isAppStoreEnvironment) return NO;
|
||||||
|
|
||||||
if (!self.isUpdateAvailable) {
|
if (!self.isUpdateAvailable) {
|
||||||
BITHockeyLog(@"Warning: No update available. Aborting.");
|
BITHockeyLog(@"WARNING: No update available. Aborting.");
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -848,9 +848,9 @@
|
|||||||
NSString *hockeyAPIURL = [NSString stringWithFormat:@"%@api/2/apps/%@?format=plist%@", _updateURL, [self encodedAppIdentifier], extraParameter];
|
NSString *hockeyAPIURL = [NSString stringWithFormat:@"%@api/2/apps/%@?format=plist%@", _updateURL, [self encodedAppIdentifier], extraParameter];
|
||||||
NSString *iOSUpdateURL = [NSString stringWithFormat:@"itms-services://?action=download-manifest&url=%@", [hockeyAPIURL bit_URLEncodedString]];
|
NSString *iOSUpdateURL = [NSString stringWithFormat:@"itms-services://?action=download-manifest&url=%@", [hockeyAPIURL bit_URLEncodedString]];
|
||||||
|
|
||||||
BITHockeyLog(@"API Server Call: %@, calling iOS with %@", hockeyAPIURL, iOSUpdateURL);
|
BITHockeyLog(@"INFO: API Server Call: %@, calling iOS with %@", hockeyAPIURL, iOSUpdateURL);
|
||||||
BOOL success = [[UIApplication sharedApplication] openURL:[NSURL URLWithString:iOSUpdateURL]];
|
BOOL success = [[UIApplication sharedApplication] openURL:[NSURL URLWithString:iOSUpdateURL]];
|
||||||
BITHockeyLog(@"System returned: %d", success);
|
BITHockeyLog(@"INFO: System returned: %d", success);
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -884,7 +884,7 @@
|
|||||||
|
|
||||||
// begin the startup process
|
// begin the startup process
|
||||||
- (void)startManager {
|
- (void)startManager {
|
||||||
BITHockeyLog(@"Start UpdateManager");
|
BITHockeyLog(@"INFO: Start UpdateManager");
|
||||||
|
|
||||||
if ([self expiryDateReached]) return;
|
if ([self expiryDateReached]) return;
|
||||||
|
|
||||||
@@ -946,7 +946,7 @@
|
|||||||
|
|
||||||
if ([self.receivedData length]) {
|
if ([self.receivedData length]) {
|
||||||
NSString *responseString = [[[NSString alloc] initWithBytes:[_receivedData bytes] length:[_receivedData length] encoding: NSUTF8StringEncoding] autorelease];
|
NSString *responseString = [[[NSString alloc] initWithBytes:[_receivedData bytes] length:[_receivedData length] encoding: NSUTF8StringEncoding] autorelease];
|
||||||
BITHockeyLog(@"Received API response: %@", responseString);
|
BITHockeyLog(@"INFO: Received API response: %@", responseString);
|
||||||
|
|
||||||
id json = [self parseJSONResultString:responseString];
|
id json = [self parseJSONResultString:responseString];
|
||||||
self.trackerConfig = (([self checkForTracker] && [[json valueForKey:@"tracker"] isKindOfClass:[NSDictionary class]]) ? [json valueForKey:@"tracker"] : nil);
|
self.trackerConfig = (([self checkForTracker] && [[json valueForKey:@"tracker"] isKindOfClass:[NSDictionary class]]) ? [json valueForKey:@"tracker"] : nil);
|
||||||
|
|||||||
Reference in New Issue
Block a user