diff --git a/Monal/Classes/HelperTools.m b/Monal/Classes/HelperTools.m index 6b5a04c194..b4daa9a421 100644 --- a/Monal/Classes/HelperTools.m +++ b/Monal/Classes/HelperTools.m @@ -344,10 +344,23 @@ +(NSString*) extractXMPPError:(XMPPStanza*) stanza withDescription:(NSString*) d +(void) initSystem { - [self configureLogging]; + BOOL enableDefaultLogAndCrashFramework = YES; +#ifdef TARGET_IPHONE_SIMULATOR + // Automatically switch between the debug technique of TMolitor and FAltheide + enableDefaultLogAndCrashFramework = [[HelperTools defaultsDB] boolForKey: @"udpLoggerEnabled"]; +#endif + if(enableDefaultLogAndCrashFramework) + { + [self configureLogging]; + [self installCrashHandler]; + [self installExceptionHandler]; + } + else + { + [self configureXcodeLogging]; + } [SwiftHelpers initSwiftHelpers]; - [self installCrashHandler]; - [self installExceptionHandler]; + [self activityLog]; } @@ -1570,6 +1583,11 @@ +(void) flushLogsWithTimeout:(double) timeout [MLUDPLogger flushWithTimeout:timeout]; } ++(void) configureXcodeLogging +{ + [DDLog addLogger:[DDTTYLogger sharedInstance]]; +} + +(void) configureLogging { //don't log to the console (aka stderr) to not create loops with our redirected stderr