Radish alpha
r
rad:zwTxygwuz5LDGBq255RA2CbNGrz8
Radicle CI broker
Radicle
Git
feat(src/logger.rs): report thread ending with error at error level
Lars Wirzenius committed 1 year ago
commit 192af400edb4538b79400c6802ccdf3e43980893
parent bcbd2ff
1 file changed +46 -19
modified src/logger.rs
@@ -409,12 +409,21 @@ pub fn queueproc_start() {
}

pub fn queueproc_end(result: &Result<(), QueueError>) {
-
    debug!(
-
        msg_id = ?Id::QueueProcEnd,
-
        kind = %Kind::Debug,
-
        ?result,
-
        "thread to process events ends"
-
    );
+
    if result.is_err() {
+
        error!(
+
            msg_id = ?Id::QueueProcEnd,
+
            kind = %Kind::Debug,
+
            ?result,
+
            "thread to process events ends"
+
        );
+
    } else {
+
        debug!(
+
            msg_id = ?Id::QueueProcEnd,
+
            kind = %Kind::Debug,
+
            ?result,
+
            "thread to process events ends"
+
        );
+
    }
}

pub fn queueproc_channel_disconnect() {
@@ -549,12 +558,21 @@ pub fn queueadd_push_event(event: &CiEvent, id: &QueueId) {
}

pub fn queueadd_end(result: &Result<(), AdderError>) {
-
    debug!(
-
        msg_id = ?Id::QueueAddEnd,
-
        kind = %Kind::Debug,
-
        ?result,
-
        "thread to process events ends"
-
    );
+
    if result.is_err() {
+
        error!(
+
            msg_id = ?Id::QueueAddEnd,
+
            kind = %Kind::Debug,
+
            ?result,
+
            "thread to process events ends"
+
        );
+
    } else {
+
        debug!(
+
            msg_id = ?Id::QueueAddEnd,
+
            kind = %Kind::Debug,
+
            ?result,
+
            "thread to process events ends"
+
        );
+
    }
}

pub fn pages_directory_unset() {
@@ -583,7 +601,7 @@ pub fn pages_disconnected() {
}

pub fn pages_start() {
-
    debug!(
+
    info!(
        msg_id = ?Id::PagesStart,
        kind = %Kind::Debug,
        "start page updater thread"
@@ -591,12 +609,21 @@ pub fn pages_start() {
}

pub fn pages_end(result: &Result<(), PageError>) {
-
    debug!(
-
        msg_id = ?Id::PagesEnd,
-
        kind = %Kind::Debug,
-
        ?result,
-
        "end page updater thread"
-
    );
+
    if result.is_err() {
+
        error!(
+
            msg_id = ?Id::PagesEnd,
+
            kind = %Kind::Debug,
+
            ?result,
+
            "end page updater thread"
+
        );
+
    } else {
+
        info!(
+
            msg_id = ?Id::PagesEnd,
+
            kind = %Kind::Debug,
+
            ?result,
+
            "end page updater thread"
+
        );
+
    }
}

pub fn event_disconnected() {