Skip to content

Commit

Permalink
support xcode debugger again
Browse files Browse the repository at this point in the history
  • Loading branch information
FriedrichAltheide committed Nov 20, 2023
1 parent 7ea3d3f commit 6de6aa4
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions Monal/Classes/HelperTools.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6de6aa4

Please sign in to comment.