@@ -277,9 +277,7 @@ void logException(NSException* exception)
277
277
NSString * prefix = @" CRASH" ;
278
278
#endif
279
279
// log error and flush all logs
280
- [DDLog flushLog ];
281
280
DDLogError (@" *****************\n %@ (%@ ): %@ \n UserInfo: %@ \n Stack Trace: %@ " , prefix, [exception name ], [exception reason ], [exception userInfo ], [exception callStackSymbols ]);
282
- [DDLog flushLog ];
283
281
[HelperTools flushLogsWithTimeout: 0.250 ];
284
282
}
285
283
@@ -598,6 +596,7 @@ +(void) initSystem
598
596
if (enableDefaultLogAndCrashFramework)
599
597
{
600
598
[self configureLogging ];
599
+ [self installExceptionHandler ];
601
600
// don't install KSCrash if the debugger is active
602
601
if (!isDebugerActive ())
603
602
[self installCrashHandler ];
@@ -2232,6 +2231,8 @@ +(void) configureXcodeLogging
2232
2231
2233
2232
+(void ) configureLogging
2234
2233
{
2234
+ NSError * error;
2235
+
2235
2236
// network logger (start as early as possible)
2236
2237
MLUDPLogger* udpLogger = [MLUDPLogger new ];
2237
2238
[DDLog addLogger: udpLogger];
@@ -2245,10 +2246,17 @@ +(void) configureLogging
2245
2246
printf (" stdout redirection complete..." );
2246
2247
2247
2248
// 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
+ */
2252
2260
2253
2261
NSString * containerUrl = [[HelperTools getContainerURLForPathComponents: @[]] path ];
2254
2262
DDLogInfo (@" Logfile dir: %@ " , containerUrl);
@@ -2265,7 +2273,6 @@ +(void) configureLogging
2265
2273
2266
2274
DDLogDebug (@" Sorted logfiles: %@ " , [logFileManager sortedLogFileInfos ]);
2267
2275
DDLogDebug (@" Current logfile: %@ " , self.fileLogger .currentLogFileInfo .filePath );
2268
- NSError * error;
2269
2276
NSDictionary * attrs = [[NSFileManager defaultManager ] attributesOfItemAtPath: self .fileLogger.currentLogFileInfo.filePath error: &error];
2270
2277
if (error)
2271
2278
DDLogError (@" File attributes error: %@ " , error);
@@ -2293,6 +2300,20 @@ +(void) configureLogging
2293
2300
NSArray * directoryContents = [[NSFileManager defaultManager ] contentsOfDirectoryAtPath: containerUrl error: nil ];
2294
2301
for (NSString * file in directoryContents)
2295
2302
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);
2296
2317
}
2297
2318
2298
2319
+(int ) pendingCrashreportCount
0 commit comments