MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / log_files

Function log_files

atomic-cli/tests/it/logging_integration_test.rs:53–66  ·  view source on GitHub ↗

The daily log files in `dir`: `atomic.YYYY-MM-DD.log`.

(dir: &Path)

Source from the content-addressed store, hash-verified

51
52/// The daily log files in `dir`: `atomic.YYYY-MM-DD.log`.
53fn log_files(dir: &Path) -> Vec<PathBuf> {
54 let Ok(entries) = fs::read_dir(dir) else {
55 return Vec::new();
56 };
57 let mut files: Vec<PathBuf> = entries
58 .map(|entry| entry.unwrap().path())
59 .filter(|path| {
60 let name = path.file_name().unwrap().to_string_lossy();
61 name.starts_with("atomic.") && name.ends_with(".log")
62 })
63 .collect();
64 files.sort();
65 files
66}
67
68fn log_text(dir: &Path) -> String {
69 log_files(dir)

Calls 5

sortMethod · 0.80
collectMethod · 0.45
pathMethod · 0.45
unwrapMethod · 0.45
file_nameMethod · 0.45

Tested by

no test coverage detected