Skip to content

Commit

Permalink
DEVOPS-10175 logger fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ipalenov committed Jun 14, 2024
1 parent 7cab050 commit 2edc861
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/addin/biterp/Logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ namespace Biterp {
}
cleanTime = now;
std::cout << "_log clean" << std::endl;
std::thread(&Logging::cleanOld, this).detach();
std::thread(&Logging::cleanOld, std::string(_path)).detach();
}

std::string buildRecord(const Logger& logger, const std::string message, int level, const std::string time){
Expand All @@ -214,12 +214,11 @@ namespace Biterp {
return record.dump();
}

static void cleanOld(Logging* thiz){
static void cleanOld(std::string path){
try{
std::cout << "clean start" << std::endl;
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;
Expand Down

0 comments on commit 2edc861

Please sign in to comment.