From bcb279a026dae6823c0022065145fb149f0bea85 Mon Sep 17 00:00:00 2001 From: Manoj S K Date: Wed, 11 Dec 2024 03:48:20 -0800 Subject: [PATCH] make logs as results instead of info --- mem.so/src/rvs_memworker.cpp | 4 ++-- rcqt.so/src/packageHandler.cpp | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/mem.so/src/rvs_memworker.cpp b/mem.so/src/rvs_memworker.cpp index ab8913b4..92514e05 100644 --- a/mem.so/src/rvs_memworker.cpp +++ b/mem.so/src/rvs_memworker.cpp @@ -134,7 +134,7 @@ void MemWorker::run_tests(char* ptr, unsigned int tot_num_blocks) std::string tname{rvs_memtests[i].desc}; tname = tname.substr(tname.find('[')+1, tname.find(']') - tname.find('[')-1); std::string passed = err == 0 ? "true" : "false"; - log_to_json(rvs::loginfo, "Test", tname, "Time Taken", tdiff_str, "errors",std::to_string(err), "pass", passed); + log_to_json(rvs::logresults, "Test", tname, "Time Taken", tdiff_str, "errors",std::to_string(err), "pass", passed); } }//for @@ -207,7 +207,7 @@ void MemWorker::run() { std::to_string(gpu_id)); rvs::lp::AddString(json_node,"Total Memory", std::to_string(total)); rvs::lp::AddString(json_node,"Free Memory", std::to_string(free)); - rvs::lp::LogRecordFlush(json_node, rvs::loginfo); + rvs::lp::LogRecordFlush(json_node, rvs::logresults); } } allocate_small_mem(); diff --git a/rcqt.so/src/packageHandler.cpp b/rcqt.so/src/packageHandler.cpp index 1db9712a..9facbe2c 100644 --- a/rcqt.so/src/packageHandler.cpp +++ b/rcqt.so/src/packageHandler.cpp @@ -82,9 +82,12 @@ void PackageHandler::validatePackages(){ std::string cumulate_deps; for (const auto& val: pkgmap){ ++totalPackages; + auto pkname = val.first.find(ORDEP) == std::string::npos ? val.first : val.first.substr(ORDEP.size()); void *pkg_node = json_node_create( module_name, m_metapkg, rvs::loginfo); if (pkg_node){ - rvs::lp::AddString(pkg_node, "depname", val.first); + if (val.first.find(ORDEP) != std::string::npos) + + rvs::lp::AddString(pkg_node, "depname", pkname); rvs::lp::AddString(pkg_node, "expected", val.second); } auto inputname = val.first; @@ -111,8 +114,9 @@ void PackageHandler::validatePackages(){ inputname = inputname.substr(ORDEP.size()); // Remove ordep identifier std::cout << "Package " << inputname << " installed version is " << installedvers << std::endl; + //rvs::lp::AddString(pkg_node, "installed",installedvers); } - rvs::lp::AddString(pkg_node, "installed", "N/A"); + rvs::lp::AddString(pkg_node, "installed", installedvers); rvs::lp::AddNode(json_node, pkg_node); } @@ -133,7 +137,7 @@ void PackageHandler::validatePackages(){ rvs::lp::AddString(res_node, "Mismatched Packages", std::to_string(badVersions)); rvs::lp::AddString(res_node, "pass", totalPackages == installedPackages ? "true" : "false"); rvs::lp::AddNode(json_node, res_node); - rvs::lp::LogRecordFlush(json_node, rvs::loginfo); + rvs::lp::LogRecordFlush(json_node, rvs::logresults); if(nullptr != callback) { rvs::action_result_t action_result; @@ -186,7 +190,7 @@ void PackageHandler::listPackageVersion(){ msg += "\tInstalled packages : " + std::to_string(installedPackages) + "\n"; std::cout << msg; - log_to_json(rvs::loginfo, kv_pairs); + log_to_json(rvs::logresults, kv_pairs); if(nullptr != callback) { rvs::action_result_t action_result;