aboutsummaryrefslogtreecommitdiff
path: root/src/lib/log/log.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-10-17 12:30:52 -0400
committerNick Mathewson <nickm@torproject.org>2019-10-17 12:30:52 -0400
commit3a73f6612aad051e0d9a9228a136e06720748c16 (patch)
treebd67b0191ff4ee96ac8db9e4aaa4519ca7c94849 /src/lib/log/log.c
parent800b823c292009dd232d9758d1b40c61072e4433 (diff)
downloadtor-3a73f6612aad051e0d9a9228a136e06720748c16.tar.gz
tor-3a73f6612aad051e0d9a9228a136e06720748c16.zip
Replace add_temp_log() with add_default_log().
We used to have this function so that we could mark our initial log-to-stdout as specifically temporary so that we would delete it once regular logs were configured. But it's no longer necessary to mark these logs as temporary, since we now use a mark-and-sweep process to ensure that _all_ not-configured logs are closed when we change our configuration. Instead, this function will be the basis of a refactoring in how we handle default logs.
Diffstat (limited to 'src/lib/log/log.c')
-rw-r--r--src/lib/log/log.c11
1 files changed, 4 insertions, 7 deletions
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, "<temp>", fileno(stdout));
+ add_stream_log_impl(s, "<default>", 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)
{