From 1696f669afcaab6a40932bed7bdacb7d61d90a4c Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Sun, 15 Dec 2024 02:06:06 -0600 Subject: [PATCH] Tone down logging --- cpp/build-packages.cpp | 214 ++++++++++++++++------------------------- 1 file changed, 83 insertions(+), 131 deletions(-) diff --git a/cpp/build-packages.cpp b/cpp/build-packages.cpp index fb6eb31..126b3dd 100644 --- a/cpp/build-packages.cpp +++ b/cpp/build-packages.cpp @@ -84,12 +84,10 @@ static void log_error(const std::string &msg) { } static void run_command_silent_on_success(const std::vector &cmd, const std::optional &cwd = std::nullopt) { - log_info("run_command_silent_on_success called with command: " + std::accumulate(cmd.begin(), cmd.end(), std::string(), - [](const std::string &a, const std::string &b) -> std::string { return a + (a.length() > 0 ? " " : "") + b; })); + log_info("Running command: " + std::accumulate(cmd.begin(), cmd.end(), std::string(), + [](const std::string &a, const std::string &b) -> std::string { return a + (a.empty() ? "" : " ") + b; })); if(cwd) { - log_info("Current working directory for command: " + cwd->string()); - } else { - log_info("No specific working directory for command."); + log_info("Executing in directory: " + cwd->string()); } std::string full_cmd; @@ -97,8 +95,6 @@ static void run_command_silent_on_success(const std::vector &cmd, c std::string exec_cmd = full_cmd; if(cwd) exec_cmd = "cd " + cwd->string() + " && " + exec_cmd; - log_info("Executing command: " + exec_cmd); - FILE* pipe = popen(exec_cmd.c_str(), "r"); if(!pipe) { log_error("Failed to run command: " + full_cmd); @@ -112,18 +108,17 @@ static void run_command_silent_on_success(const std::vector &cmd, c } } int ret = pclose(pipe); - log_info("Command executed with return code: " + std::to_string(ret)); if (ret != 0) { - log_error("Command failed: " + full_cmd); + log_error("Command failed with code " + std::to_string(ret) + ": " + full_cmd); log_error("Output:\n" + ss.str()); throw std::runtime_error("Command execution failed"); } else { - log_info("Command succeeded: " + full_cmd); + log_info("Command executed successfully: " + full_cmd); } } +// Initialize libgit2 once static void git_init_once() { - log_info("git_init_once called"); static std::once_flag flag; std::call_once(flag, [](){ log_info("Initializing libgit2"); @@ -133,7 +128,7 @@ static void git_init_once() { } static void git_fetch_and_checkout(const fs::path &repo_path, const std::string &repo_url, const std::optional &branch) { - log_info("git_fetch_and_checkout called with repo_path: " + repo_path.string() + ", repo_url: " + repo_url + ", branch: " + (branch ? *branch : "none")); + log_info("Fetching and checking out repository: " + repo_url + " into " + repo_path.string()); git_init_once(); git_repository* repo = nullptr; bool need_clone = false; @@ -141,7 +136,7 @@ static void git_fetch_and_checkout(const fs::path &repo_path, const std::string log_info("Repository path exists. Attempting to open repository."); int err = git_repository_open(&repo, repo_path.string().c_str()); if(err<0) { - log_warning("Cannot open repo at " + repo_path.string() + ", recloning"); + log_warning("Cannot open repo at " + repo_path.string() + ", recloning."); fs::remove_all(repo_path); need_clone = true; } else { @@ -153,7 +148,6 @@ static void git_fetch_and_checkout(const fs::path &repo_path, const std::string } if(!need_clone && repo!=nullptr) { - log_info("Checking remote 'origin' for repository."); git_remote* remote = nullptr; int err = git_remote_lookup(&remote, repo, "origin"); if(err<0) { @@ -164,24 +158,23 @@ static void git_fetch_and_checkout(const fs::path &repo_path, const std::string } else { const char* url = git_remote_url(remote); if(!url || repo_url != url) { - log_info("Remote URL differs (current: " + std::string(url ? url : "null") + "). Removing and recloning."); + log_info("Remote URL differs (current: " + std::string(url ? url : "null") + "). Recloning."); git_remote_free(remote); git_repository_free(repo); fs::remove_all(repo_path); need_clone = true; } else { - log_info("Remote URL matches. Proceeding to fetch."); - // fetch + log_info("Remote URL matches. Fetching latest changes."); + // Fetch git_remote_free(remote); git_remote* origin = nullptr; git_remote_lookup(&origin, repo, "origin"); git_fetch_options fetch_opts = GIT_FETCH_OPTIONS_INIT; git_remote_fetch(origin, nullptr, &fetch_opts, nullptr); - log_info("Fetch completed."); git_remote_free(origin); + log_info("Fetch completed."); if(branch) { - log_info("Checking out branch: " + *branch); git_reference* ref = nullptr; std::string fullbranch = "refs/remotes/origin/" + *branch; if(git_reference_lookup(&ref, repo, fullbranch.c_str())==0) { @@ -195,7 +188,7 @@ static void git_fetch_and_checkout(const fs::path &repo_path, const std::string git_object_free(target); log_info("Checked out branch: " + *branch); } else { - log_error("Branch " + *branch + " not found, recloning"); + log_error("Branch " + *branch + " not found, recloning."); git_repository_free(repo); fs::remove_all(repo_path); need_clone = true; @@ -222,7 +215,6 @@ static void git_fetch_and_checkout(const fs::path &repo_path, const std::string log_info("Repository cloned successfully."); if(branch) { - log_info("Checking out branch after clone: " + *branch); git_reference* ref = nullptr; std::string fullbranch = "refs/remotes/origin/" + *branch; if(git_reference_lookup(&ref, newrepo, fullbranch.c_str())==0) { @@ -243,7 +235,7 @@ static void git_fetch_and_checkout(const fs::path &repo_path, const std::string } git_repository_free(newrepo); } - log_info("git_fetch_and_checkout completed for " + repo_path.string()); + log_info("Finished fetching and checking out repository: " + repo_path.string()); } static YAML::Node load_config(const fs::path &config_path) { @@ -258,9 +250,8 @@ static YAML::Node load_config(const fs::path &config_path) { } static void publish_lintian() { - log_info("publish_lintian called."); + log_info("Publishing Lintian results."); if(!BASE_LINTIAN_DIR.empty() && fs::exists(BASE_LINTIAN_DIR)) { - log_info("Publishing lintian results from " + BASE_LINTIAN_DIR); for (auto &p : fs::recursive_directory_iterator(BASE_LINTIAN_DIR)) { if (fs::is_regular_file(p)) { fs::path rel = fs::relative(p.path(), BASE_LINTIAN_DIR); @@ -269,21 +260,22 @@ static void publish_lintian() { std::error_code ec; fs::copy_file(p.path(), dest, fs::copy_options::overwrite_existing, ec); if(ec) { - log_error("Failed to copy lintian file: " + p.path().string() + " to " + dest.string() + ". Error: " + ec.message()); + log_error("Failed to copy Lintian file: " + p.path().string() + " to " + dest.string() + ". Error: " + ec.message()); } else { - log_info("Copied lintian file: " + p.path().string() + " to " + dest.string()); + log_info("Copied Lintian file: " + p.path().string() + " to " + dest.string()); } } } fs::remove_all(BASE_LINTIAN_DIR); - log_info("Removed temporary lintian directory: " + BASE_LINTIAN_DIR); + log_info("Removed temporary Lintian directory: " + BASE_LINTIAN_DIR); } else { - log_info("No lintian directory to publish."); + log_info("No Lintian directory to publish."); } } +// Define get_exclusions here before usage static std::vector get_exclusions(const fs::path &packaging) { - log_info("get_exclusions called for packaging directory: " + packaging.string()); + log_info("Retrieving exclusions from: " + packaging.string()); std::vector exclusions; fs::path cpr = packaging / "debian" / "copyright"; if(!fs::exists(cpr)) { @@ -337,7 +329,7 @@ int main(int argc, char** argv) { std::string uuid_part = current_time.substr(0,8); BASE_LINTIAN_DIR = BASE_OUTPUT_DIR + "/.lintian.tmp." + uuid_part; fs::create_directories(BASE_LINTIAN_DIR); - log_info("Created lintian temporary directory: " + BASE_LINTIAN_DIR); + log_info("Created Lintian temporary directory: " + BASE_LINTIAN_DIR); fs::path log_file = fs::path(LOG_DIR) / (current_time + ".log"); log_info("Opening log file: " + log_file.string()); @@ -353,16 +345,16 @@ int main(int argc, char** argv) { std::string config_path; for(int i=1; istd::optional{ - log_info("Determining packaging branch for package."); if(pkg["packaging_branch"] && pkg["packaging_branch"].IsScalar()) { std::string branch = pkg["packaging_branch"].as(); - log_info("Packaging branch found in package config: " + branch); + log_info("Packaging branch for package: " + branch); return branch; } else if (releases.size()>0) { std::string branch = "ubuntu/" + releases[0].as(); - log_info("Defaulting packaging branch to: " + branch); + log_info("Default packaging branch set to: " + branch); return branch; } - log_info("No packaging branch specified."); return std::nullopt; }; @@ -429,7 +419,7 @@ int main(int argc, char** argv) { throw std::runtime_error("Invalid changelog format"); } std::string version_match = first_line.substr(start+1,end-(start+1)); - log_info("Extracted version string: " + version_match); + log_info("Extracted version: " + version_match); std::string epoch; std::string upstream_version = version_match; if(auto pos=version_match.find(':'); pos!=std::string::npos) { @@ -439,11 +429,11 @@ int main(int argc, char** argv) { } if(auto pos=upstream_version.find('-'); pos!=std::string::npos) { upstream_version=upstream_version.substr(0,pos); - log_info("Trimmed upstream version to: " + upstream_version); + log_info("Trimmed upstream version: " + upstream_version); } std::regex git_regex("(\\+git[0-9]+)?(~[a-z]+)?$"); upstream_version = std::regex_replace(upstream_version, git_regex, ""); - log_info("Upstream version after regex replacement: " + upstream_version); + log_info("Upstream version after regex: " + upstream_version); auto t = std::time(nullptr); std::tm tm = *std::gmtime(&t); char buf_version[32]; @@ -460,17 +450,16 @@ int main(int argc, char** argv) { }; auto run_source_lintian = [&](const std::string &name, const fs::path &source_path){ - log_info("Running Lintian for package: " + name + " with source path: " + source_path.string()); + log_info("Running Lintian for package: " + name); fs::path temp_file = fs::temp_directory_path() / ("lintian_suppress_" + name + ".txt"); { std::ofstream of(temp_file); for (auto &tag: SUPPRESSED_LINTIAN_TAGS) { of<&1"; - log_info("Executing Lintian command: " + cmd); FILE* pipe = popen(cmd.c_str(),"r"); std::stringstream ss; if(pipe) { @@ -479,84 +468,65 @@ int main(int argc, char** argv) { ss< &changes_files, const std::vector &devel_changes_files){ - log_info("dput_source called for package: " + name + ", upload_target: " + upload_target); + log_info("Uploading changes for package: " + name + " to " + upload_target); if(!changes_files.empty()) { std::string hr_changes; - for(auto &c: changes_files) { - hr_changes += c+" "; - log_info("Change file to upload: " + c); - } - log_info("Uploading " + hr_changes + "to " + upload_target + " using dput"); + for(auto &c: changes_files) hr_changes += c+" "; + log_info("Changes files: " + hr_changes); std::vector cmd = {"dput",upload_target}; for(auto &c: changes_files) cmd.push_back(c); try { run_command_silent_on_success(cmd, OUTPUT_DIR); - log_info("Completed upload of changes to " + upload_target); + log_info("Successfully uploaded changes for package: " + name); for(auto &file: devel_changes_files) { if(!file.empty()) { - log_info("Running Lintian on devel changes file: " + file); run_source_lintian(name,file); } } } catch (...) { log_error("Failed to upload changes for package: " + name); - // error logged already + // Errors are already logged in run_command_silent_on_success } } else { - log_info("No changes files to upload for package: " + name); + log_warning("No changes files to upload for package: " + name); } }; auto update_changelog = [&](const fs::path &packaging_dir, const std::string &release, const std::string &version_with_epoch){ std::string name = packaging_dir.filename().string(); log_info("Updating changelog for " + name + " to version " + version_with_epoch + "-0ubuntu1~ppa1"); - try { - run_command_silent_on_success({"git","checkout","debian/changelog"}, packaging_dir); - log_info("Checked out debian/changelog for " + name); - } catch (const std::exception &e) { - log_error("Failed to checkout debian/changelog for " + name + ": " + e.what()); - throw; - } + run_command_silent_on_success({"git","checkout","debian/changelog"}, packaging_dir); std::vector cmd={ "dch","--distribution",release,"--package",name,"--newversion",version_with_epoch+"-0ubuntu1~ppa1","--urgency",urgency_level_override,"CI upload." }; - log_info("Running dch command to update changelog for " + name); - try { - run_command_silent_on_success(cmd, packaging_dir); - log_info("Changelog updated successfully for " + name); - } catch (const std::exception &e) { - log_error("Failed to update changelog for " + name + ": " + e.what()); - throw; - } + run_command_silent_on_success(cmd, packaging_dir); + log_info("Changelog updated for " + name); }; auto build_package = [&](const fs::path &packaging_dir, const std::map &env_vars, bool large) -> std::string { @@ -566,26 +536,26 @@ int main(int argc, char** argv) { if(large) { temp_dir = fs::path(OUTPUT_DIR)/(".tmp_"+name+"_"+env_vars.at("VERSION")); fs::create_directories(temp_dir); - log_warning(name+" is quite large and will not fit in /tmp, building at "+temp_dir.string()); + log_warning(name+" is large; building in " + temp_dir.string()); } else { temp_dir = fs::temp_directory_path()/("tmp_build_"+name+"_"+env_vars.at("VERSION")); fs::create_directories(temp_dir); - log_info("Temporary build directory created at " + temp_dir.string()); + log_info("Created temporary build directory: " + temp_dir.string()); } std::error_code ec; fs::path temp_packaging_dir = temp_dir/name; fs::create_directories(temp_packaging_dir, ec); if(ec) { - log_error("Failed to create temporary packaging directory: " + temp_packaging_dir.string() + ". Error: " + ec.message()); - throw std::runtime_error("Failed to create temporary packaging directory."); + log_error("Failed to create temporary packaging directory: " + temp_packaging_dir.string()); + throw std::runtime_error("Temporary packaging directory creation failed"); } - log_info("Temporary packaging directory created at " + temp_packaging_dir.string()); + log_info("Temporary packaging directory created at: " + temp_packaging_dir.string()); fs::copy(packaging_dir/"debian", temp_packaging_dir/"debian", fs::copy_options::recursive, ec); if(ec) { log_error("Failed to copy debian directory to temporary packaging directory: " + ec.message()); - throw std::runtime_error("Failed to copy debian directory."); + throw std::runtime_error("Failed to copy debian directory"); } log_info("Copied debian directory to temporary packaging directory."); @@ -594,8 +564,8 @@ int main(int argc, char** argv) { fs::path tarball_dest = temp_dir/tarball_name; fs::copy_file(tarball_source, tarball_dest, fs::copy_options::overwrite_existing, ec); if(ec) { - log_error("Failed to copy tarball from " + tarball_source.string() + " to " + tarball_dest.string() + ". Error: " + ec.message()); - throw std::runtime_error("Failed to copy tarball."); + log_error("Failed to copy tarball from " + tarball_source.string() + " to " + tarball_dest.string()); + throw std::runtime_error("Failed to copy tarball"); } log_info("Copied tarball to " + tarball_dest.string()); @@ -605,16 +575,9 @@ int main(int argc, char** argv) { } std::vector cmd_build={"debuild","--no-lintian","-S","-d","-sa","-nc"}; - log_info("Running debuild command in " + temp_packaging_dir.string()); - try { - run_command_silent_on_success(cmd_build, temp_packaging_dir); - run_command_silent_on_success({"git","checkout","debian/changelog"}, packaging_dir); - log_info("Completed debuild and reset changelog for " + name); - } catch(...) { - fs::remove_all(temp_dir, ec); - log_error("Build failed for " + name + ". Cleaned up temporary directory."); - throw; - } + run_command_silent_on_success(cmd_build, temp_packaging_dir); + run_command_silent_on_success({"git","checkout","debian/changelog"}, packaging_dir); + log_info("Built package for " + name); std::string pattern = name+"_"+env_vars.at("VERSION"); std::string changes_file; @@ -623,10 +586,8 @@ int main(int argc, char** argv) { if(fname.rfind(pattern,0)==0) { fs::path dest=fs::path(OUTPUT_DIR)/fname; fs::copy_file(entry.path(), dest, fs::copy_options::overwrite_existing, ec); - if(ec) { - log_error("Failed to copy built package " + fname + " to " + OUTPUT_DIR + ". Error: " + ec.message()); - } else { - log_info("Copied " + fname + " to " + OUTPUT_DIR); + if(!ec) { + log_info("Copied built package " + fname + " to " + OUTPUT_DIR); } } } @@ -636,13 +597,12 @@ int main(int argc, char** argv) { if(fname.rfind(name+"_"+env_vars.at("VERSION"),0)==0 && fname.ends_with("_source.changes")) { changes_file=entry.path().string(); log_info("Found changes file: " + changes_file); - break; } } fs::remove_all(temp_dir, ec); if(ec) { - log_warning("Failed to remove temporary directory: " + temp_dir.string() + ". Error: " + ec.message()); + log_warning("Failed to remove temporary directory: " + temp_dir.string()); } else { log_info("Removed temporary build directory: " + temp_dir.string()); } @@ -658,18 +618,18 @@ int main(int argc, char** argv) { auto process_package = [&](const YAML::Node &pkg){ std::string name = pkg["name"] ? pkg["name"].as() : ""; std::string upload_target = pkg["upload_target"] ? pkg["upload_target"].as() : "ppa:lubuntu-ci/unstable-ci-proposed"; - log_info("Processing package: " + name + " with upload target: " + upload_target); if(name.empty()) { log_warning("Skipping package due to missing name."); return; } + log_info("Processing package: " + name); fs::path packaging_destination = fs::path(BASE_DIR)/name; fs::path changelog_path = packaging_destination/"debian"/"changelog"; std::string version = parse_version(changelog_path); bool large = pkg["large"] ? pkg["large"].as() : false; if(large) { - log_info("Package " + name + " marked as large."); + log_info("Package " + name + " is marked as large."); } std::vector>> built_changes; @@ -692,7 +652,7 @@ int main(int argc, char** argv) { std::error_code ec; fs::copy_file(tarball_source, tarball_dest, fs::copy_options::overwrite_existing, ec); if(ec) { - log_error("Failed to copy tarball for " + name + " to " + tarball_dest.string() + ". Error: " + ec.message()); + log_error("Failed to copy tarball for " + name + " to " + tarball_dest.string()); continue; } log_info("Copied tarball to " + tarball_dest.string()); @@ -711,7 +671,6 @@ int main(int argc, char** argv) { std::string changes_file = build_package(packaging_destination, env_map, large); if(!changes_file.empty()) { built_changes.emplace_back(changes_file, env_map); - log_info("Recorded built changes file: " + changes_file); } } catch(std::exception &e) { log_error("Error processing package '"+name+"' for release '"+release+"': "+std::string(e.what())); @@ -719,7 +678,7 @@ int main(int argc, char** argv) { fs::remove(tarball_dest, ec); if(ec) { - log_warning("Failed to remove tarball: " + tarball_dest.string() + ". Error: " + ec.message()); + log_warning("Failed to remove tarball: " + tarball_dest.string()); } else { log_info("Removed tarball: " + tarball_dest.string()); } @@ -729,7 +688,6 @@ int main(int argc, char** argv) { for(auto &bc: built_changes) { fs::path cf(bc.first); changes_files.push_back(cf.filename().string()); - log_info("Collected changes file: " + cf.filename().string()); } std::unordered_set devel_changes_files; @@ -738,10 +696,8 @@ int main(int argc, char** argv) { for (auto &f: changes_files) { if(f.find("~"+first_release)!=std::string::npos) { devel_changes_files.insert((fs::path(OUTPUT_DIR)/f).string()); - log_info("Added to devel changes files: " + (fs::path(OUTPUT_DIR)/f).string()); } else { devel_changes_files.insert(std::string()); - log_info("Added empty string to devel changes files."); } } } @@ -753,15 +709,15 @@ int main(int argc, char** argv) { if(getenv("DEBFULLNAME")==nullptr) { setenv("DEBFULLNAME",DEBFULLNAME.c_str(),1); - log_info("Set environment variable DEBFULLNAME for package: " + name); + log_info("Set DEBFULLNAME environment variable."); } if(getenv("DEBEMAIL")==nullptr) { setenv("DEBEMAIL",DEBEMAIL.c_str(),1); - log_info("Set environment variable DEBEMAIL for package: " + name); + log_info("Set DEBEMAIL environment variable."); } if(skip_dput) { - log_info("Skipping dput for package: " + name); + log_info("Skipping dput upload for package: " + name); for (auto &file : devel_changes_files) { if(!file.empty()) { run_source_lintian(name,file); @@ -769,7 +725,6 @@ int main(int argc, char** argv) { } } else { std::string real_upload_target = built_changes[0].second.at("UPLOAD_TARGET"); - log_info("Uploading changes for package: " + name + " to " + real_upload_target); dput_source(name, real_upload_target, changes_files, std::vector(devel_changes_files.begin(), devel_changes_files.end())); } @@ -779,22 +734,21 @@ int main(int argc, char** argv) { auto prepare_package = [&](const YAML::Node &pkg){ std::string name = pkg["name"] ? pkg["name"].as() : ""; - log_info("Preparing package: " + name); if(name.empty()) { log_warning("Skipping package due to missing name."); return; } + log_info("Preparing package: " + name); std::string upstream_url = pkg["upstream_url"] ? pkg["upstream_url"].as() : ("https://github.com/lxqt/"+name+".git"); - log_info("Upstream URL for " + name + ": " + upstream_url); + log_info("Upstream URL: " + upstream_url); fs::path upstream_destination = fs::path(BASE_DIR)/("upstream-"+name); std::optional packaging_branch = get_packaging_branch(pkg); std::string packaging_url = pkg["packaging_url"] ? pkg["packaging_url"].as() : ("https://git.lubuntu.me/Lubuntu/"+name+"-packaging.git"); - log_info("Packaging URL for " + name + ": " + packaging_url); + log_info("Packaging URL: " + packaging_url); fs::path packaging_destination = fs::path(BASE_DIR)/name; try { - log_info("Fetching and checking out upstream repository for " + name); git_fetch_and_checkout(upstream_destination, upstream_url, std::nullopt); } catch(...) { log_error("Failed to prepare upstream repo for " + name); @@ -802,7 +756,6 @@ int main(int argc, char** argv) { } try { - log_info("Fetching and checking out packaging repository for " + name); git_fetch_and_checkout(packaging_destination, packaging_url, packaging_branch); } catch(...) { log_error("Failed to prepare packaging repo for " + name); @@ -810,45 +763,44 @@ int main(int argc, char** argv) { } try { - log_info("Updating maintainer scripts for " + name); + log_info("Updating maintainer for package: " + name); update_maintainer((packaging_destination/"debian").string(), false); - log_info("Maintainer scripts updated for " + name); + log_info("Maintainer updated for package: " + name); } catch(std::exception &e) { - log_warning("update_maintainer: "+std::string(e.what())+" for "+name); + log_warning("update_maintainer error for " + name + ": " + std::string(e.what())); } auto exclusions = get_exclusions(packaging_destination); - log_info("Creating tarball for " + name); + log_info("Creating tarball for package: " + name); create_tarball(name, upstream_destination, exclusions); - log_info("Tarball created for " + name); + log_info("Tarball created for package: " + name); process_package(pkg); }; std::vector> futures; - log_info("Starting package preparation with " + std::to_string(packages.size()) + " packages."); + log_info("Starting package preparation for " + std::to_string(packages.size()) + " packages."); for(auto pkg: packages) { - log_info("Submitting package to be prepared: " + (pkg["name"] ? pkg["name"].as() : "Unnamed")); futures.push_back(std::async(std::launch::async, prepare_package, pkg)); } for(auto &fut: futures) { try { fut.get(); - log_info("Package processing completed successfully."); + log_info("Package processed successfully."); } catch(std::exception &e) { log_error(std::string("Task generated an exception: ")+e.what()); } } if(!skip_cleanup) { - log_info("Performing cleanup of output directory: " + OUTPUT_DIR); + log_info("Cleaning up output directory: " + OUTPUT_DIR); fs::remove_all(OUTPUT_DIR); log_info("Cleanup completed."); } else { log_info("Skipping cleanup as per flag."); } - log_info("Publishing Lintian output..."); + log_info("Publishing Lintian results."); publish_lintian(); log_info("Cleaning old logs."); clean_old_logs(fs::path(LOG_DIR));