From 5739bcbb7bcb6b518979cc7a6a97867d7dba9ae0 Mon Sep 17 00:00:00 2001 From: Oskar Thoren Date: Tue, 28 Nov 2017 20:00:03 +0100 Subject: [PATCH] Put status-go in geth.log again Fix absolute dir and statement order. Regression appears to have been introduced during network configuration changes 2-3 months ago and noone checked this file since then. --- modules/react-native-status/ios/RCTStatus/RCTStatus.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/react-native-status/ios/RCTStatus/RCTStatus.m b/modules/react-native-status/ios/RCTStatus/RCTStatus.m index 7021af3df0..66190f1e12 100644 --- a/modules/react-native-status/ios/RCTStatus/RCTStatus.m +++ b/modules/react-native-status/ios/RCTStatus/RCTStatus.m @@ -162,9 +162,11 @@ RCT_EXPORT_METHOD(startNode:(NSString *)configString) { NSString *config = [NSString stringWithUTF8String: configChars]; configData = [config dataUsingEncoding:NSUTF8StringEncoding]; NSDictionary *resultingConfigJson = [NSJSONSerialization JSONObjectWithData:configData options:NSJSONReadingMutableContainers error:nil]; + NSURL *networkDirUrl = [NSURL fileURLWithPath:networkDir]; + NSURL *logUrl = [networkDirUrl URLByAppendingPathComponent:@"geth.log"]; [resultingConfigJson setValue:newKeystoreUrl.path forKey:@"KeyStoreDir"]; [resultingConfigJson setValue:[NSNumber numberWithBool:YES] forKey:@"LogEnabled"]; - [resultingConfigJson setValue:@"geth.log" forKey:@"LogFile"]; + [resultingConfigJson setValue:logUrl.path forKey:@"LogFile"]; [resultingConfigJson setValue:@"DEBUG" forKey:@"LogLevel"]; if(upstreamURL != nil) { @@ -173,8 +175,6 @@ RCT_EXPORT_METHOD(startNode:(NSString *)configString) { } NSString *resultingConfig = [resultingConfigJson bv_jsonStringWithPrettyPrint:NO]; NSLog(@"node config %@", resultingConfig); - NSURL *networkDirUrl = [NSURL fileURLWithPath:networkDir]; - NSURL *logUrl = [networkDirUrl URLByAppendingPathComponent:@"geth.log"]; if([fileManager fileExistsAtPath:logUrl.path]) { [fileManager removeItemAtPath:logUrl.path error:nil]; }