From 931beba56f359bb0381e46fd8499abce3db8ec2e Mon Sep 17 00:00:00 2001 From: tearfur <46261767+tearfur@users.noreply.github.com> Date: Tue, 4 Apr 2023 04:37:28 +0800 Subject: [PATCH] fix: set log level before constructing tr_session (#5345) --- libtransmission/session.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libtransmission/session.cc b/libtransmission/session.cc index f91ff5f97..c8c4168d9 100644 --- a/libtransmission/session.cc +++ b/libtransmission/session.cc @@ -577,16 +577,16 @@ tr_session* tr_sessionInit(char const* config_dir, bool message_queueing_enabled tr_timeUpdate(time(nullptr)); - /* initialize the bare skeleton of the session object */ - auto* const session = new tr_session{ config_dir }; - bandwidthGroupRead(session, config_dir); - // nice to start logging at the very beginning if (auto val = int64_t{}; tr_variantDictFindInt(client_settings, TR_KEY_message_level, &val)) { tr_logSetLevel(static_cast(val)); } + /* initialize the bare skeleton of the session object */ + auto* const session = new tr_session{ config_dir }; + bandwidthGroupRead(session, config_dir); + auto data = tr_session::init_data{}; data.config_dir = config_dir; data.message_queuing_enabled = message_queueing_enabled;