Skip to content

Commit

Permalink
DEVOPS-10175 logger off
Browse files Browse the repository at this point in the history
  • Loading branch information
ipalenov committed Jun 13, 2024
1 parent 5e538de commit 23a794b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/addin/biterp/Logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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)){
Expand All @@ -232,7 +234,7 @@ namespace Biterp {
}
auto diff = now - system_clock::from_time_t(mktime(&tm));
if (duration_cast<seconds>(diff).count() > KEEP_TIME){
fs::remove(entry.path());
fs::remove(entry.path(), err);
}
}
}catch(...){
Expand Down

0 comments on commit 23a794b

Please sign in to comment.