@@ -275,9 +275,11 @@ void logException(NSException* exception)
275
275
NSString * prefix = @" CRASH" ;
276
276
#endif
277
277
// log error and flush all logs
278
+ DDLogWarn (@" Crash pending!!!" );
278
279
[DDLog flushLog ];
279
280
DDLogError (@" *****************\n %@ (%@ ): %@ \n UserInfo: %@ \n Stack Trace: %@ " , prefix, [exception name ], [exception reason ], [exception userInfo ], [exception callStackSymbols ]);
280
281
[DDLog flushLog ];
282
+ DDLogWarn (@" Crash logged!!!" );
281
283
[HelperTools flushLogsWithTimeout: 0.250 ];
282
284
}
283
285
@@ -286,11 +288,11 @@ void uncaughtExceptionHandler(NSException* exception)
286
288
logException (exception );
287
289
288
290
// 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
+ // }
294
296
295
297
// make sure this crash will be recorded by kscrash using the NSException rather than the c++ exception thrown by the objc runtime
296
298
// this will make sure that the stacktrace matches the objc exception rather than being a top level c++ stacktrace
@@ -599,10 +601,10 @@ +(void) initSystem
599
601
{
600
602
[self configureLogging ];
601
603
// don't install KSCrash if the debugger is active
602
- if (!isDebugerActive ())
604
+ // if(!isDebugerActive())
603
605
[self installCrashHandler ];
604
- else
605
- DDLogWarn (@" Not installing crash handler: debugger is active!" );
606
+ // else
607
+ // DDLogWarn(@"Not installing crash handler: debugger is active!");
606
608
[self installExceptionHandler ];
607
609
}
608
610
else
@@ -2220,6 +2222,8 @@ +(void) configureXcodeLogging
2220
2222
2221
2223
+(void ) configureLogging
2222
2224
{
2225
+ NSError * error;
2226
+
2223
2227
// network logger (start as early as possible)
2224
2228
MLUDPLogger* udpLogger = [MLUDPLogger new ];
2225
2229
[DDLog addLogger: udpLogger];
@@ -2233,10 +2237,17 @@ +(void) configureLogging
2233
2237
printf (" stdout redirection complete..." );
2234
2238
2235
2239
// 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
2240
+ /*
2241
+ OSLogStore* osLogStore = [OSLogStore storeWithScope:OSLogStoreCurrentProcessIdentifier error:&error];
2242
+ if(error)
2243
+ DDLogError(@"Failed to open os log store: %@", error);
2244
+ else
2245
+ {
2246
+ dispatch_async(, ^{
2247
+ [osLogStore entriesEnumeratorAndReturnError:&error];
2248
+ });
2249
+ }
2250
+ */
2240
2251
2241
2252
NSString * containerUrl = [[HelperTools getContainerURLForPathComponents: @[]] path ];
2242
2253
DDLogInfo (@" Logfile dir: %@ " , containerUrl);
@@ -2253,7 +2264,6 @@ +(void) configureLogging
2253
2264
2254
2265
DDLogDebug (@" Sorted logfiles: %@ " , [logFileManager sortedLogFileInfos ]);
2255
2266
DDLogDebug (@" Current logfile: %@ " , self.fileLogger .currentLogFileInfo .filePath );
2256
- NSError * error;
2257
2267
NSDictionary * attrs = [[NSFileManager defaultManager ] attributesOfItemAtPath: self .fileLogger.currentLogFileInfo.filePath error: &error];
2258
2268
if (error)
2259
2269
DDLogError (@" File attributes error: %@ " , error);
@@ -2281,6 +2291,20 @@ +(void) configureLogging
2281
2291
NSArray * directoryContents = [[NSFileManager defaultManager ] contentsOfDirectoryAtPath: containerUrl error: nil ];
2282
2292
for (NSString * file in directoryContents)
2283
2293
DDLogVerbose (@" File %@ /%@ " , containerUrl, file);
2294
+
2295
+ NSArray * paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES );
2296
+ NSString * documentsUrl = [paths objectAtIndex: 0 ];
2297
+ documentsUrl = [documentsUrl stringByAppendingPathComponent: @" .." ];
2298
+ documentsUrl = [documentsUrl stringByAppendingPathComponent: @" Library" ];
2299
+ directoryContents = [[NSFileManager defaultManager ] contentsOfDirectoryAtPath: documentsUrl error: nil ];
2300
+ for (NSString * file in directoryContents)
2301
+ DDLogVerbose (@" App File %@ /%@ " , documentsUrl, file);
2302
+ documentsUrl = [paths objectAtIndex: 0 ];
2303
+ documentsUrl = [documentsUrl stringByAppendingPathComponent: @" .." ];
2304
+ documentsUrl = [documentsUrl stringByAppendingPathComponent: @" SystemData" ];
2305
+ directoryContents = [[NSFileManager defaultManager ] contentsOfDirectoryAtPath: documentsUrl error: nil ];
2306
+ for (NSString * file in directoryContents)
2307
+ DDLogVerbose (@" App File %@ /%@ " , documentsUrl, file);
2284
2308
}
2285
2309
2286
2310
+(int ) pendingCrashreportCount
0 commit comments