Skip to content

Commit 613e2d2

Browse files
authored
Add logging for from directory (#1045)
This PR adds logging of the source directories to the dump command.
1 parent 71e7713 commit 613e2d2

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/collector/rrdp/base.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,10 @@ impl Collector {
151151
#[allow(clippy::mutable_key_type)]
152152
pub fn dump(&self, dir: &Path) -> Result<(), Fatal> {
153153
let dir = dir.join("rrdp");
154-
debug!("Dumping RRDP collector content to {}", dir.display());
154+
debug!("Dumping RRDP collector content from {} to {}",
155+
self.working_dir.display(),
156+
dir.display()
157+
);
155158
let mut registry = DumpRegistry::new(dir);
156159
let mut states = HashMap::new();
157160
for entry in fatal::read_dir(&self.working_dir)? {

src/collector/rsync.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ impl Collector {
130130
/// Dumps the content of the rsync collector.
131131
pub fn dump(&self, dir: &Path) -> Result<(), Failed> {
132132
let target = dir.join("rsync");
133-
debug!("Dumping rsync collector content to {}", target.display());
133+
debug!("Dumping rsync collector content from {} to {}",
134+
self.working_dir.base.display(),
135+
target.display()
136+
);
134137

135138
if let Err(err) = fs::remove_dir_all(&target) {
136139
if err.kind() != io::ErrorKind::NotFound {

src/store.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ impl Store {
161161
pub fn dump(&self, dir: &Path) -> Result<(), Failed> {
162162
self.dump_ta_certs(dir)?;
163163
let dir = dir.join("store");
164-
debug!("Dumping store content to {}", dir.display());
164+
debug!("Dumping store content from {} to {}",
165+
self.path.display(),
166+
dir.display()
167+
);
165168
fatal::remove_dir_all(&dir)?;
166169
let mut repos = DumpRegistry::new(dir);
167170
self.dump_tree(&self.rsync_repository_path(), &mut repos)?;

0 commit comments

Comments
 (0)