mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 07:42:40 +00:00
AppDelegate: Enable log to file earlier
Try another technique to save logs to files earlier.
The goal is to track unexpected app startup cycle like in https://riot.im/bugreports/listing/2017-12-29/081732/console.1.log.gz (https://github.com/matrix-org/riot-ios-rageshakes/issues/797) and https://riot.im/bugreports/listing/2017-12-31/133345/console.log.gz (https://github.com/matrix-org/riot-ios-rageshakes/issues/805).
(cherry picked from commit 879f42782a
)
# Conflicts:
# Riot/AppDelegate.m
This commit is contained in:
parent
1df6904d00
commit
c09171d62f
1 changed files with 20 additions and 11 deletions
|
@ -214,6 +214,26 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
|
|||
|
||||
#pragma mark -
|
||||
|
||||
+ (void)initialize
|
||||
{
|
||||
NSLog(@"[AppDelegate] initialize");
|
||||
|
||||
// Set the App Group identifier.
|
||||
MXSDKOptions *sdkOptions = [MXSDKOptions sharedInstance];
|
||||
sdkOptions.applicationGroupIdentifier = @"group.im.vector";
|
||||
|
||||
// Track SDK performance on Google analytics
|
||||
sdkOptions.analyticsDelegate = [[MXGoogleAnalytics alloc] init];
|
||||
|
||||
// Redirect NSLogs to files only if we are not debugging
|
||||
if (!isatty(STDERR_FILENO))
|
||||
{
|
||||
[MXLogger redirectNSLogToFiles:YES];
|
||||
}
|
||||
|
||||
NSLog(@"[AppDelegate] initialize: Done");
|
||||
}
|
||||
|
||||
+ (AppDelegate*)theDelegate
|
||||
{
|
||||
return (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
||||
|
@ -314,17 +334,6 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
|
|||
|
||||
- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(nullable NSDictionary *)launchOptions
|
||||
{
|
||||
NSLog(@"[AppDelegate] willFinishLaunchingWithOptions");
|
||||
|
||||
// Set the App Group identifier.
|
||||
MXSDKOptions *sdkOptions = [MXSDKOptions sharedInstance];
|
||||
sdkOptions.applicationGroupIdentifier = @"group.im.vector";
|
||||
|
||||
// Redirect NSLogs to files only if we are not debugging
|
||||
if (!isatty(STDERR_FILENO)) {
|
||||
[MXLogger redirectNSLogToFiles:YES];
|
||||
}
|
||||
|
||||
NSLog(@"[AppDelegate] willFinishLaunchingWithOptions: Done");
|
||||
|
||||
return YES;
|
||||
|
|
Loading…
Reference in a new issue