@@ -277,9 +277,7 @@ void logException(NSException* exception)
277277 NSString * prefix = @" CRASH" ;
278278#endif
279279 // log error and flush all logs
280- [DDLog flushLog ];
281280 DDLogError (@" *****************\n %@ (%@ ): %@ \n UserInfo: %@ \n Stack Trace: %@ " , prefix, [exception name ], [exception reason ], [exception userInfo ], [exception callStackSymbols ]);
282- [DDLog flushLog ];
283281 [HelperTools flushLogsWithTimeout: 0.250 ];
284282}
285283
@@ -598,6 +596,7 @@ +(void) initSystem
598596 if (enableDefaultLogAndCrashFramework)
599597 {
600598 [self configureLogging ];
599+ [self installExceptionHandler ];
601600 // don't install KSCrash if the debugger is active
602601 if (!isDebugerActive ())
603602 [self installCrashHandler ];
@@ -2232,6 +2231,8 @@ +(void) configureXcodeLogging
22322231
22332232+(void ) configureLogging
22342233{
2234+ NSError * error;
2235+
22352236 // network logger (start as early as possible)
22362237 MLUDPLogger* udpLogger = [MLUDPLogger new ];
22372238 [DDLog addLogger: udpLogger];
@@ -2245,10 +2246,17 @@ +(void) configureLogging
22452246 printf (" stdout redirection complete..." );
22462247
22472248 // redirect apple system logs, too
2248- #pragma clang diagnostic push
2249- #pragma clang diagnostic ignored "-Wdeprecated-declarations"
2250- [DDASLLogCapture start ];
2251- #pragma clang diagnostic pop
2249+ /*
2250+ OSLogStore* osLogStore = [OSLogStore storeWithScope:OSLogStoreCurrentProcessIdentifier error:&error];
2251+ if(error)
2252+ DDLogError(@"Failed to open os log store: %@", error);
2253+ else
2254+ {
2255+ dispatch_async(, ^{
2256+ [osLogStore entriesEnumeratorAndReturnError:&error];
2257+ });
2258+ }
2259+ */
22522260
22532261 NSString * containerUrl = [[HelperTools getContainerURLForPathComponents: @[]] path ];
22542262 DDLogInfo (@" Logfile dir: %@ " , containerUrl);
@@ -2265,7 +2273,6 @@ +(void) configureLogging
22652273
22662274 DDLogDebug (@" Sorted logfiles: %@ " , [logFileManager sortedLogFileInfos ]);
22672275 DDLogDebug (@" Current logfile: %@ " , self.fileLogger .currentLogFileInfo .filePath );
2268- NSError * error;
22692276 NSDictionary * attrs = [[NSFileManager defaultManager ] attributesOfItemAtPath: self .fileLogger.currentLogFileInfo.filePath error: &error];
22702277 if (error)
22712278 DDLogError (@" File attributes error: %@ " , error);
@@ -2293,6 +2300,20 @@ +(void) configureLogging
22932300 NSArray * directoryContents = [[NSFileManager defaultManager ] contentsOfDirectoryAtPath: containerUrl error: nil ];
22942301 for (NSString * file in directoryContents)
22952302 DDLogVerbose (@" File %@ /%@ " , containerUrl, file);
2303+
2304+ NSArray * paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES );
2305+ NSString * documentsUrl = [paths objectAtIndex: 0 ];
2306+ documentsUrl = [documentsUrl stringByAppendingPathComponent: @" .." ];
2307+ documentsUrl = [documentsUrl stringByAppendingPathComponent: @" Library" ];
2308+ directoryContents = [[NSFileManager defaultManager ] contentsOfDirectoryAtPath: documentsUrl error: nil ];
2309+ for (NSString * file in directoryContents)
2310+ DDLogVerbose (@" App File %@ /%@ " , documentsUrl, file);
2311+ documentsUrl = [paths objectAtIndex: 0 ];
2312+ documentsUrl = [documentsUrl stringByAppendingPathComponent: @" .." ];
2313+ documentsUrl = [documentsUrl stringByAppendingPathComponent: @" SystemData" ];
2314+ directoryContents = [[NSFileManager defaultManager ] contentsOfDirectoryAtPath: documentsUrl error: nil ];
2315+ for (NSString * file in directoryContents)
2316+ DDLogVerbose (@" App File %@ /%@ " , documentsUrl, file);
22962317}
22972318
22982319+(int ) pendingCrashreportCount
0 commit comments