Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
fetch: Improve logging of clone
cloudhead committed 2 years ago
commit e19c773a86acbdb931213d21b15249dec26454c3
parent 976b58ba7a2622e134dd50704ecf7d5aa7a826e9
2 files changed +17 -7
modified radicle-fetch/src/lib.rs
@@ -103,13 +103,23 @@ where
    let result = state
        .run(handle, &handshake, limit, remote, None)
        .map_err(Error::Protocol);
+
    let elapsed = start.elapsed().as_millis();
+
    let rid = handle.repo.id();

-
    log::debug!(
-
        target: "fetch",
-
        "Finished clone of {} ({}ms)",
-
        handle.repo.id(),
-
        start.elapsed().as_millis(),
-
    );
+
    match &result {
+
        Ok(_) => {
+
            log::debug!(
+
                target: "fetch",
+
                "Finished clone of {rid} from {remote} ({elapsed}ms)",
+
            );
+
        }
+
        Err(e) => {
+
            log::debug!(
+
                target: "fetch",
+
                "Clone of {rid} from {remote} failed with '{e}' ({elapsed}ms)",
+
            );
+
        }
+
    }
    result
}

modified radicle-node/src/wire/protocol.rs
@@ -372,7 +372,7 @@ where
    }

    fn worker_result(&mut self, task: TaskResult) {
-
        log::trace!(
+
        log::debug!(
            target: "wire",
            "Received fetch result from worker for stream {}, remote {}: {:?}",
            task.stream, task.remote, task.result