diff options
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/config.c | 19 | ||||
-rw-r--r-- | src/or/or.h | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c index 676e7f605b..0f662a617d 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -403,6 +403,7 @@ static config_var_t option_vars_[] = { V(LogTimeGranularity, MSEC_INTERVAL, "1 second"), V(TruncateLogFile, BOOL, "0"), V(SyslogIdentityTag, STRING, NULL), + V(AndroidIdentityTag, STRING, NULL), V(LongLivedPorts, CSV, "21,22,706,1863,5050,5190,5222,5223,6523,6667,6697,8300"), VAR("MapAddress", LINELIST, AddressMap, NULL), @@ -4692,6 +4693,12 @@ options_transition_allowed(const or_options_t *old, return -1; } + if (!opt_streq(old->AndroidIdentityTag, new_val->AndroidIdentityTag)) { + *msg = tor_strdup("While Tor is running, changing " + "AndroidIdentityTag is not allowed."); + return -1; + } + if ((old->HardwareAccel != new_val->HardwareAccel) || !opt_streq(old->AccelName, new_val->AccelName) || !opt_streq(old->AccelDir, new_val->AccelDir)) { @@ -5743,6 +5750,18 @@ options_init_logs(const or_options_t *old_options, or_options_t *options, #endif /* defined(HAVE_SYSLOG_H) */ goto cleanup; } + + if (!strcasecmp(smartlist_get(elts, 0), "android")) { +#ifdef HAVE_ANDROID_LOG_H + if (!validate_only) { + add_android_log(severity, options->AndroidIdentityTag); + } +#else + log_warn(LD_CONFIG, "Android logging is not supported" + " on this system. Sorry."); +#endif // HAVE_ANDROID_LOG_H. + goto cleanup; + } } if (smartlist_len(elts) == 2 && diff --git a/src/or/or.h b/src/or/or.h index b078022326..aff43f195b 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -3639,6 +3639,7 @@ typedef struct { int TruncateLogFile; /**< Boolean: Should we truncate the log file before we start writing? */ char *SyslogIdentityTag; /**< Identity tag to add for syslog logging. */ + char *AndroidIdentityTag; /**< Identity tag to add for Android logging. */ char *DebugLogFile; /**< Where to send verbose log messages. */ char *DataDirectory_option; /**< Where to store long-term data, as |