mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-06 16:07:42 +02:00
Merge pull request #1721 from vector-im/early_log_init
AppDelegate: Enable log to file earlier
This commit is contained in:
+20
-14
@@ -223,6 +223,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];
|
||||
@@ -323,20 +343,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";
|
||||
|
||||
// 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] willFinishLaunchingWithOptions: Done");
|
||||
|
||||
return YES;
|
||||
|
||||
Reference in New Issue
Block a user