From 50bad13f86bd8d47265f6b8a6349d33755b2e3e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D1=82=D0=BE=D0=BD?= Date: Thu, 8 Jan 2026 12:20:51 +0300 Subject: [PATCH] =?UTF-8?q?=D0=91=D0=B0=D0=B7=D0=B0=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20=D1=80=D1=83=D1=87=D0=BA=D0=B8=20PostUserMedicationsExecutor?= =?UTF-8?q?.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/endpoints_handlers/GetUserMedicationsExecutor.h | 4 ++-- src/endpoints_handlers/PostUserMedicationsExecutor.h | 4 ++-- src/log/Log.cpp | 8 +++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/endpoints_handlers/GetUserMedicationsExecutor.h b/src/endpoints_handlers/GetUserMedicationsExecutor.h index 71b189a..d57814b 100644 --- a/src/endpoints_handlers/GetUserMedicationsExecutor.h +++ b/src/endpoints_handlers/GetUserMedicationsExecutor.h @@ -46,7 +46,7 @@ public: if (req[http::field::authorization].size() <= auth_prefix.size()) { - BOOST_LOG_TRIVIAL(info) << invalid_token_message; + BOOST_LOG_TRIVIAL(error) << invalid_token_message; throw session_exception(http::status::unauthorized, "Unauthorized"); } @@ -54,7 +54,7 @@ public: if (!auth_dao_->HasAuthorized(auth_token)) { - BOOST_LOG_TRIVIAL(info) << invalid_token_message; + BOOST_LOG_TRIVIAL(error) << invalid_token_message; throw session_exception(http::status::unauthorized, "Unauthorized"); } diff --git a/src/endpoints_handlers/PostUserMedicationsExecutor.h b/src/endpoints_handlers/PostUserMedicationsExecutor.h index 3e69e36..3918fc7 100644 --- a/src/endpoints_handlers/PostUserMedicationsExecutor.h +++ b/src/endpoints_handlers/PostUserMedicationsExecutor.h @@ -46,7 +46,7 @@ public: if (req[http::field::authorization].size() <= auth_prefix.size()) { - BOOST_LOG_TRIVIAL(info) << invalid_token_message; + BOOST_LOG_TRIVIAL(error) << invalid_token_message; throw session_exception(http::status::unauthorized, "Unauthorized"); } @@ -54,7 +54,7 @@ public: if (!auth_dao_->HasAuthorized(auth_token)) { - BOOST_LOG_TRIVIAL(info) << invalid_token_message; + BOOST_LOG_TRIVIAL(error) << invalid_token_message; throw session_exception(http::status::unauthorized, "Unauthorized"); } diff --git a/src/log/Log.cpp b/src/log/Log.cpp index 2315e20..7f9c040 100644 --- a/src/log/Log.cpp +++ b/src/log/Log.cpp @@ -14,9 +14,11 @@ void InitLogs() logging::keywords::file_name = "app_%Y-%m-%d_%H-%M-%S.log", logging::keywords::rotation_size = 10 * 1024 * 1024, logging::keywords::time_based_rotation = - logging::sinks::file::rotation_at_time_point(0, 0, 0), - logging::keywords::format = "[%TimeStamp%] [%Severity%]: %Message%" - ); + logging::sinks::file::rotation_at_time_point(0, 0, 0), + logging::keywords::format = + "[%TimeStamp%] [%Severity%]: %Message%" + ); + logging::add_common_attributes(); } }