Disable geth.log in release builds. Fixes #4782

Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
Pedro Pombeiro 2018-06-15 16:06:01 +02:00
parent b40b042b67
commit 3b4d7eebc7
No known key found for this signature in database
GPG Key ID: A65DEB11E4BBC647
3 changed files with 5 additions and 5 deletions

View File

@ -5,7 +5,7 @@ MAINNET_WARNING_ENABLED=1
OFFLINE_INBOX_ENABLED=1 OFFLINE_INBOX_ENABLED=1
RPC_NETWORKS_ONLY=1 RPC_NETWORKS_ONLY=1
LOG_LEVEL=info LOG_LEVEL=info
LOG_LEVEL_STATUS_GO=info LOG_LEVEL_STATUS_GO=
QUEUE_MESSAGE_ENABLED=0 QUEUE_MESSAGE_ENABLED=0
RN_BRIDGE_THRESHOLD_WARNINGS=0 RN_BRIDGE_THRESHOLD_WARNINGS=0
POW_TARGET=0.002 POW_TARGET=0.002

View File

@ -216,10 +216,10 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
JSONObject jsonConfig = new JSONObject(config); JSONObject jsonConfig = new JSONObject(config);
String gethLogFilePath = prepareLogsFile(); String gethLogFilePath = TextUtils.isEmpty(this.logLevel) ? null : prepareLogsFile();
boolean logsEnabled = (gethLogFilePath != null) && !TextUtils.isEmpty(this.logLevel); boolean logsEnabled = (gethLogFilePath != null);
jsonConfig.put("LogEnabled", (gethLogFilePath != null && logsEnabled)); jsonConfig.put("LogEnabled", logsEnabled);
jsonConfig.put("LogFile", gethLogFilePath); jsonConfig.put("LogFile", gethLogFilePath);
jsonConfig.put("LogLevel", TextUtils.isEmpty(this.logLevel) ? "ERROR" : this.logLevel.toUpperCase()); jsonConfig.put("LogLevel", TextUtils.isEmpty(this.logLevel) ? "ERROR" : this.logLevel.toUpperCase());
jsonConfig.put("DataDir", dataDir); jsonConfig.put("DataDir", dataDir);

View File

@ -179,7 +179,7 @@ RCT_EXPORT_METHOD(startNode:(NSString *)configString) {
NSURL *logUrl = [networkDirUrl URLByAppendingPathComponent:@"geth.log"]; NSURL *logUrl = [networkDirUrl URLByAppendingPathComponent:@"geth.log"];
[resultingConfigJson setValue:newKeystoreUrl.path forKey:@"KeyStoreDir"]; [resultingConfigJson setValue:newKeystoreUrl.path forKey:@"KeyStoreDir"];
[resultingConfigJson setValue:[NSNumber numberWithBool:[logLevel length] != 0] forKey:@"LogEnabled"]; [resultingConfigJson setValue:[NSNumber numberWithBool:[logLevel length] != 0] forKey:@"LogEnabled"];
[resultingConfigJson setValue:logUrl.path forKey:@"LogFile"]; [resultingConfigJson setValue:([logLevel length] == 0 ? [NSNull null] : logUrl.path) forKey:@"LogFile"];
[resultingConfigJson setValue:([logLevel length] == 0 ? [NSString stringWithUTF8String: "ERROR"] : logLevel) forKey:@"LogLevel"]; [resultingConfigJson setValue:([logLevel length] == 0 ? [NSString stringWithUTF8String: "ERROR"] : logLevel) forKey:@"LogLevel"];
[resultingConfigJson setValue:[NSNumber numberWithBool:YES] forKeyPath:@"WhisperConfig.LightClient"]; [resultingConfigJson setValue:[NSNumber numberWithBool:YES] forKeyPath:@"WhisperConfig.LightClient"];