diff --git a/modules/react-native-status/android/src/main/java/im/status/ethereum/module/StatusModule.java b/modules/react-native-status/android/src/main/java/im/status/ethereum/module/StatusModule.java index dae7e25480..f4a76fe01a 100644 --- a/modules/react-native-status/android/src/main/java/im/status/ethereum/module/StatusModule.java +++ b/modules/react-native-status/android/src/main/java/im/status/ethereum/module/StatusModule.java @@ -182,7 +182,7 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL String gethLogFileName = "geth.log"; jsonConfig.put("LogEnabled", !TextUtils.isEmpty(this.logLevel)); jsonConfig.put("LogFile", gethLogFileName); - jsonConfig.put("LogLevel", this.logLevel.toUpperCase()); + jsonConfig.put("LogLevel", TextUtils.isEmpty(this.logLevel) ? "ERROR" : this.logLevel.toUpperCase()); jsonConfig.put("DataDir", root + customConfig.get("DataDir")); jsonConfig.put("NetworkId", customConfig.get("NetworkId")); try { @@ -228,7 +228,12 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL Log.d(TAG, "Node config " + config); String res = Statusgo.StartNode(config); - Log.d(TAG, "StartNode result: " + res); + if (res.startsWith("{\"error\":\"\"")) { + Log.d(TAG, "StartNode result: " + res); + } + else { + Log.e(TAG, "StartNode result: " + res); + } Log.d(TAG, "Geth node started"); status.sendMessage(); } diff --git a/modules/react-native-status/ios/RCTStatus/RCTStatus.m b/modules/react-native-status/ios/RCTStatus/RCTStatus.m index fc81055883..bae782aecc 100644 --- a/modules/react-native-status/ios/RCTStatus/RCTStatus.m +++ b/modules/react-native-status/ios/RCTStatus/RCTStatus.m @@ -203,7 +203,7 @@ RCT_EXPORT_METHOD(startNode:(NSString *)configString) { [resultingConfigJson setValue:newKeystoreUrl.path forKey:@"KeyStoreDir"]; [resultingConfigJson setValue:[NSNumber numberWithBool:[logLevel length] != 0] forKey:@"LogEnabled"]; [resultingConfigJson setValue:logUrl.path forKey:@"LogFile"]; - [resultingConfigJson setValue:logLevel forKey:@"LogLevel"]; + [resultingConfigJson setValue:([logLevel length] == 0 ? "ERROR" : logLevel) forKey:@"LogLevel"]; if(upstreamURL != nil) { [resultingConfigJson setValue:[NSNumber numberWithBool:YES] forKeyPath:@"UpstreamConfig.Enabled"];