From 23a794b37528e171aff61025570e638804e277ae Mon Sep 17 00:00:00 2001 From: Ivan Palenov Date: Thu, 13 Jun 2024 15:44:19 +0300 Subject: [PATCH] DEVOPS-10175 logger off --- src/addin/biterp/Logger.hpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/addin/biterp/Logger.hpp b/src/addin/biterp/Logger.hpp index 9f260ab..db9b9e1 100644 --- a/src/addin/biterp/Logger.hpp +++ b/src/addin/biterp/Logger.hpp @@ -92,6 +92,7 @@ namespace Biterp { } inline static void log(int level, const std::string &text, const Logger& logger) { + return; instance()._log(level, text, logger); } @@ -202,11 +203,12 @@ namespace Biterp { } static void cleanOld(Logging* thiz){ - auto now = system_clock::now(); - std::tm tm = {}; - std::string path = thiz->_path; try{ - if (!path.empty() && !fs::exists(path)){ + auto now = system_clock::now(); + std::tm tm = {}; + std::string path = thiz->_path; + std::error_code err; + if (!path.empty() && !fs::exists(path, err)){ return; } for (const auto & entry : fs::directory_iterator(path)){ @@ -232,7 +234,7 @@ namespace Biterp { } auto diff = now - system_clock::from_time_t(mktime(&tm)); if (duration_cast(diff).count() > KEEP_TIME){ - fs::remove(entry.path()); + fs::remove(entry.path(), err); } } }catch(...){