@@ -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
@@ -598,11 +600,12 @@ +(void) initSystem
598
600
if (enableDefaultLogAndCrashFramework)
599
601
{
600
602
[self configureLogging ];
603
+ [self installExceptionHandler ];
601
604
// 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!");
606
609
[self installExceptionHandler ];
607
610
}
608
611
else
@@ -2220,6 +2223,8 @@ +(void) configureXcodeLogging
2220
2223
2221
2224
+(void ) configureLogging
2222
2225
{
2226
+ NSError * error;
2227
+
2223
2228
// network logger (start as early as possible)
2224
2229
MLUDPLogger* udpLogger = [MLUDPLogger new ];
2225
2230
[DDLog addLogger: udpLogger];
@@ -2233,10 +2238,17 @@ +(void) configureLogging
2233
2238
printf (" stdout redirection complete..." );
2234
2239
2235
2240
// 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
+ */
2240
2252
2241
2253
NSString * containerUrl = [[HelperTools getContainerURLForPathComponents: @[]] path ];
2242
2254
DDLogInfo (@" Logfile dir: %@ " , containerUrl);
@@ -2253,7 +2265,6 @@ +(void) configureLogging
2253
2265
2254
2266
DDLogDebug (@" Sorted logfiles: %@ " , [logFileManager sortedLogFileInfos ]);
2255
2267
DDLogDebug (@" Current logfile: %@ " , self.fileLogger .currentLogFileInfo .filePath );
2256
- NSError * error;
2257
2268
NSDictionary * attrs = [[NSFileManager defaultManager ] attributesOfItemAtPath: self .fileLogger.currentLogFileInfo.filePath error: &error];
2258
2269
if (error)
2259
2270
DDLogError (@" File attributes error: %@ " , error);
@@ -2281,6 +2292,20 @@ +(void) configureLogging
2281
2292
NSArray * directoryContents = [[NSFileManager defaultManager ] contentsOfDirectoryAtPath: containerUrl error: nil ];
2282
2293
for (NSString * file in directoryContents)
2283
2294
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);
2284
2309
}
2285
2310
2286
2311
+(int ) pendingCrashreportCount
0 commit comments