ark::logging::LogCleaner

Defined in header “ark/logging/log_cleaner.hh”.


The logging cleanup engine allows you to analyze a directory tree for manifests and split files; it provides an interface to safely remove old manifests, and erase any split files that depended on them.

This class is intended to be used from either an external tool or as live stage onboard.

Methods

  • LogCleaner(const std::filesystem::path & path)
    Constructor. Initializes the cleanup engine against the given base log path.

  • void rescan()
    Rescans the original base path, updating the manifests/split files that could be removed.

  • std::vector< ManifestCleanupMetadata > manifests()
    Returns all of the manifests that this cleanup engine has discovered, sorted in time order.

  • std::vector< std::filesystem::path > unknown_files()
    Returns all ‘unknown’ files that we found. These are files that we could not parse as manifests.

  • std::vector< std::filesystem::path > files_to_delete(size_t bytes_to_remove)
    Returns all of the files that should be removed, based on the list of manifest cleanup metadata provided. Returns not just manifests, but split files that should be deleted as-if those manifests were erased.

    This uses the default filter settings, with the exception of bytes_to_remove.

  • std::vector< std::filesystem::path > files_to_delete(const LogCleanerFilter & filter)
    Returns all of the files that should be removed, based on the list of manifest cleanup metadata provided. Returns not just manifests, but split files that should be deleted as-if those manifests were erased.