Initialise logging before trying to use it in unit tests

This commit is contained in:
teor (Tim Wilson-Brown) 2016-02-05 14:28:53 +11:00 committed by Nick Mathewson
parent add8acf428
commit a7a98e27ea

View File

@ -228,6 +228,9 @@ main(int c, const char **v)
int loglevel = LOG_ERR; int loglevel = LOG_ERR;
int accel_crypto = 0; int accel_crypto = 0;
/* We must initialise logs before we call tor_assert() */
init_logging(1);
#ifdef USE_DMALLOC #ifdef USE_DMALLOC
{ {
int r = CRYPTO_set_mem_ex_functions(tor_malloc_, tor_realloc_, tor_free_); int r = CRYPTO_set_mem_ex_functions(tor_malloc_, tor_realloc_, tor_free_);
@ -239,7 +242,6 @@ main(int c, const char **v)
options = options_new(); options = options_new();
tor_threads_init(); tor_threads_init();
control_initialize_event_queue(); control_initialize_event_queue();
init_logging(1);
configure_backtrace_handler(get_version()); configure_backtrace_handler(get_version());
for (i_out = i = 1; i < c; ++i) { for (i_out = i = 1; i < c; ++i) {