@@ -275,9 +275,11 @@ void logException(NSException* exception)
275275 NSString * prefix = @" CRASH" ;
276276#endif
277277 // log error and flush all logs
278+ DDLogWarn (@" Crash pending!!!" );
278279 [DDLog flushLog ];
279280 DDLogError (@" *****************\n %@ (%@ ): %@ \n UserInfo: %@ \n Stack Trace: %@ " , prefix, [exception name ], [exception reason ], [exception userInfo ], [exception callStackSymbols ]);
280281 [DDLog flushLog ];
282+ DDLogWarn (@" Crash logged!!!" );
281283 [HelperTools flushLogsWithTimeout: 0.250 ];
282284}
283285
@@ -286,11 +288,11 @@ void uncaughtExceptionHandler(NSException* exception)
286288 logException (exception);
287289
288290 // don't report that crash through KSCrash if the debugger is active
289- if (isDebugerActive ())
290- {
291- DDLogError (@" Not reporting crash through KSCrash: debugger is active!" );
292- return ;
293- }
291+ // if(isDebugerActive())
292+ // {
293+ // DDLogError(@"Not reporting crash through KSCrash: debugger is active!");
294+ // return;
295+ // }
294296
295297 // make sure this crash will be recorded by kscrash using the NSException rather than the c++ exception thrown by the objc runtime
296298 // this will make sure that the stacktrace matches the objc exception rather than being a top level c++ stacktrace
@@ -598,11 +600,12 @@ +(void) initSystem
598600 if (enableDefaultLogAndCrashFramework)
599601 {
600602 [self configureLogging ];
603+ [self installExceptionHandler ];
601604 // don't install KSCrash if the debugger is active
602- if (!isDebugerActive ())
603- [self installCrashHandler ];
604- else
605- DDLogWarn (@" Not installing crash handler: debugger is active!" );
605+ // if(!isDebugerActive())
606+ // [self installCrashHandler];
607+ // else
608+ // DDLogWarn(@"Not installing crash handler: debugger is active!");
606609 [self installExceptionHandler ];
607610 }
608611 else
@@ -2220,6 +2223,8 @@ +(void) configureXcodeLogging
22202223
22212224+(void ) configureLogging
22222225{
2226+ NSError * error;
2227+
22232228 // network logger (start as early as possible)
22242229 MLUDPLogger* udpLogger = [MLUDPLogger new ];
22252230 [DDLog addLogger: udpLogger];
@@ -2233,10 +2238,17 @@ +(void) configureLogging
22332238 printf (" stdout redirection complete..." );
22342239
22352240 // redirect apple system logs, too
2236- #pragma clang diagnostic push
2237- #pragma clang diagnostic ignored "-Wdeprecated-declarations"
2238- [DDASLLogCapture start ];
2239- #pragma clang diagnostic pop
2241+ /*
2242+ OSLogStore* osLogStore = [OSLogStore storeWithScope:OSLogStoreCurrentProcessIdentifier error:&error];
2243+ if(error)
2244+ DDLogError(@"Failed to open os log store: %@", error);
2245+ else
2246+ {
2247+ dispatch_async(, ^{
2248+ [osLogStore entriesEnumeratorAndReturnError:&error];
2249+ });
2250+ }
2251+ */
22402252
22412253 NSString * containerUrl = [[HelperTools getContainerURLForPathComponents: @[]] path ];
22422254 DDLogInfo (@" Logfile dir: %@ " , containerUrl);
@@ -2253,7 +2265,6 @@ +(void) configureLogging
22532265
22542266 DDLogDebug (@" Sorted logfiles: %@ " , [logFileManager sortedLogFileInfos ]);
22552267 DDLogDebug (@" Current logfile: %@ " , self.fileLogger .currentLogFileInfo .filePath );
2256- NSError * error;
22572268 NSDictionary * attrs = [[NSFileManager defaultManager ] attributesOfItemAtPath: self .fileLogger.currentLogFileInfo.filePath error: &error];
22582269 if (error)
22592270 DDLogError (@" File attributes error: %@ " , error);
@@ -2281,6 +2292,20 @@ +(void) configureLogging
22812292 NSArray * directoryContents = [[NSFileManager defaultManager ] contentsOfDirectoryAtPath: containerUrl error: nil ];
22822293 for (NSString * file in directoryContents)
22832294 DDLogVerbose (@" File %@ /%@ " , containerUrl, file);
2295+
2296+ NSArray * paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES );
2297+ NSString * documentsUrl = [paths objectAtIndex: 0 ];
2298+ documentsUrl = [documentsUrl stringByAppendingPathComponent: @" .." ];
2299+ documentsUrl = [documentsUrl stringByAppendingPathComponent: @" Library" ];
2300+ directoryContents = [[NSFileManager defaultManager ] contentsOfDirectoryAtPath: documentsUrl error: nil ];
2301+ for (NSString * file in directoryContents)
2302+ DDLogVerbose (@" App File %@ /%@ " , documentsUrl, file);
2303+ documentsUrl = [paths objectAtIndex: 0 ];
2304+ documentsUrl = [documentsUrl stringByAppendingPathComponent: @" .." ];
2305+ documentsUrl = [documentsUrl stringByAppendingPathComponent: @" SystemData" ];
2306+ directoryContents = [[NSFileManager defaultManager ] contentsOfDirectoryAtPath: documentsUrl error: nil ];
2307+ for (NSString * file in directoryContents)
2308+ DDLogVerbose (@" App File %@ /%@ " , documentsUrl, file);
22842309}
22852310
22862311+(int ) pendingCrashreportCount
0 commit comments