From 24b5f11b130ed2ff0412f6e4c1c126353764f350 Mon Sep 17 00:00:00 2001 From: shockrah Date: Wed, 12 May 2021 14:14:30 -0700 Subject: [PATCH] * Better logging in meta module(more logging tags) --- json-api/src/meta.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/json-api/src/meta.rs b/json-api/src/meta.rs index fb9ebd4..37e5926 100644 --- a/json-api/src/meta.rs +++ b/json-api/src/meta.rs @@ -32,7 +32,7 @@ lazy_static! { let rr: JsonResult = serde_json::from_reader(reader); match rr { Ok(meta) => meta, - Err(e) => panic!("{}", e) + Err(e) => panic!("[HTTP] [FATAL-INIT] {}", e) } }, @@ -82,7 +82,7 @@ pub async fn add_neighbor(p: &Pool, response: &mut Response, body: Body) { match row.is_some() { true => *response.status_mut() = StatusCode::CONFLICT, false => if let Err(e) = db::neighbors::add_neighbor(p, neighbor).await { - eprintln!("{}", e); + eprintln!("[HTTP] [DB-LIB] {}", e); } }; } else { @@ -108,14 +108,14 @@ pub async fn update_neighbor(p: &Pool, response: &mut Response, params: Ha Ok(row) => if row.is_some() { if let Err(e) = db::neighbors::update(p, target_url, neighbor).await { *response.status_mut() = StatusCode::INTERNAL_SERVER_ERROR; - eprintln!("/neighbor/update [DB-LIB] {}", e); + eprintln!("[HTTP] [DB-LIB] /neighbor/update [DB-LIB] {}", e); } // Nothing to do on success 200 is already set by hyper } else{ *response.status_mut() = StatusCode::NOT_FOUND; }, Err(e) => { - eprintln!("/neighbor/update {}", e); + eprintln!("[HTTP] [DB-LIB] /neighbor/update {}", e); *response.status_mut() = StatusCode::INTERNAL_SERVER_ERROR; } }