From b1bb8561f55b041a668c6e2d789db4555fe16996 Mon Sep 17 00:00:00 2001 From: Viacheslav Demydiuk Date: Mon, 11 Nov 2024 15:44:41 +0200 Subject: [PATCH] MtService: changed log level to INFO for release version --- MtService/MtService.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/MtService/MtService.cpp b/MtService/MtService.cpp index 40413376..4b1b5d4e 100755 --- a/MtService/MtService.cpp +++ b/MtService/MtService.cpp @@ -75,7 +75,7 @@ MtServiceImpl::~MtServiceImpl() void MtServiceImpl::InitExpert(int port, int handle, std::unique_ptr mt_handler) { - log_.Debug("%s: port = %d, handle = %d", __FUNCTION__, port, handle); + log_.Info("%s: port = %d, handle = %d", __FUNCTION__, port, handle); boost::asio::post(context_, [port, handle, mt_h = std::move(mt_handler), this]() mutable { auto expert = std::make_unique(handle, std::move(mt_h)); @@ -93,7 +93,7 @@ void MtServiceImpl::InitExpert(int port, int handle, std::unique_ptr 0) @@ -182,7 +182,15 @@ void MtServiceImpl::ThreadProc() MtService::MtService() { - LogConfigurator::Setup(LogLevel::Trace, OutputType::Console | OutputType::File, "MtApiService"); +#ifdef NDEBUG + // nondebug + auto log_level = LogLevel::Info; +#else + // debug code + auto log_level = LogLevel::Trace; +#endif + + LogConfigurator::Setup(log_level, OutputType::Console | OutputType::File, "MtApiService"); impl_ = std::make_unique(); }