diff --git a/src/app/main/main.c b/src/app/main/main.c index 2d75793366..e6bd4f30b2 100644 --- a/src/app/main/main.c +++ b/src/app/main/main.c @@ -564,11 +564,11 @@ tor_init(int argc, char *argv[]) break; case QUIET_HUSH: /* --hush: log at warning or higher. */ - add_temp_log(LOG_WARN); + add_default_log(LOG_WARN); break; case QUIET_NONE: /* fall through */ default: - add_temp_log(LOG_NOTICE); + add_default_log(LOG_NOTICE); } quiet_level = quiet; diff --git a/src/lib/log/log.c b/src/lib/log/log.c index 83f04a3467..ddd0eac6e7 100644 --- a/src/lib/log/log.c +++ b/src/lib/log/log.c @@ -995,18 +995,16 @@ logs_set_domain_logging(int enabled) UNLOCK_LOGS(); } -/** Add a log handler to receive messages during startup (before the real - * logs are initialized). +/** Add a log handler to accept messages when no other log is configured. */ void -add_temp_log(int min_severity) +add_default_log(int min_severity) { log_severity_list_t *s = tor_malloc_zero(sizeof(log_severity_list_t)); set_log_severity_config(min_severity, LOG_ERR, s); LOCK_LOGS(); - add_stream_log_impl(s, "", fileno(stdout)); + add_stream_log_impl(s, "", fileno(stdout)); tor_free(s); - logfiles->is_temporary = 1; UNLOCK_LOGS(); } @@ -1149,8 +1147,7 @@ flush_log_messages_from_startup(void) UNLOCK_LOGS(); } -/** Close any log handlers added by add_temp_log() or marked by - * mark_logs_temp(). */ +/** Close any log handlers marked by mark_logs_temp(). */ void close_temp_logs(void) { diff --git a/src/lib/log/log.h b/src/lib/log/log.h index 8e36012616..4dead0fd2c 100644 --- a/src/lib/log/log.h +++ b/src/lib/log/log.h @@ -185,7 +185,7 @@ int get_min_log_level(void); void switch_logs_debug(void); void logs_free_all(void); void logs_close_sigsafe(void); -void add_temp_log(int min_severity); +void add_default_log(int min_severity); void close_temp_logs(void); void rollback_log_changes(void); void mark_logs_temp(void);