From d42a8ba42e00fab56b33ed3caa153d71f3a3143e Mon Sep 17 00:00:00 2001 From: status102 <102887808+status102@users.noreply.github.com> Date: Sun, 20 Apr 2025 16:44:48 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20MaaCore=E6=97=A5=E5=BF=97=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=8D=A0=E7=94=A8=E7=BC=93=E8=A7=A3,=20=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E5=A4=A7=E5=B0=8F=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaCore/Utils/Logger.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/MaaCore/Utils/Logger.hpp b/src/MaaCore/Utils/Logger.hpp index d84d481f19..d25ba3dbaf 100644 --- a/src/MaaCore/Utils/Logger.hpp +++ b/src/MaaCore/Utils/Logger.hpp @@ -770,15 +770,16 @@ private: if (!std::filesystem::exists(m_log_path) || !std::filesystem::is_regular_file(m_log_path)) { return; } + m_buff.close(); m_ofs.close(); std::filesystem::rename(m_log_path, m_log_bak_path); - LoadFileStream(); } catch (std::filesystem::filesystem_error& e) { std::cerr << e.what() << std::endl; } catch (...) { } + LoadFileStream(); } void LoadFileStream()