From 1e6b61df8500e52b1296193e10ba7039d0b1dc62 Mon Sep 17 00:00:00 2001 From: Philip Jenvey Date: Fri, 28 Dec 2018 16:22:39 -0800 Subject: [PATCH] refactor: prefer regular slog macro names --- src/error.rs | 4 ++-- src/http.rs | 4 ++-- src/main.rs | 7 +------ 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/error.rs b/src/error.rs index be46500..3e68d63 100644 --- a/src/error.rs +++ b/src/error.rs @@ -139,9 +139,9 @@ impl<'r> Responder<'r> for HandlerError { let log = RequestLogger::with_request(request).map_err(|_| Status::InternalServerError)?; match status { Status::Unauthorized | Status::Forbidden => { - slog_warn!(log, "{}", &self; "code" => status.code, "errno" => errno) + warn!(log, "{}", &self; "code" => status.code, "errno" => errno) } - _ => slog_debug!(log, "{}", &self; "code" => status.code, "errno" => errno), + _ => debug!(log, "{}", &self; "code" => status.code, "errno" => errno), } let json = json!({ diff --git a/src/http.rs b/src/http.rs index 64a3584..c09fad4 100644 --- a/src/http.rs +++ b/src/http.rs @@ -97,7 +97,7 @@ fn broadcast( let version = version?.value; let created = broadcaster?.broadcast_new_version(&conn, &bchannel_id, &version)?; let status = if created { Status::Created } else { Status::Ok }; - slog_info!( + info!( log, "Broadcast: {}/{} new version: {}", broadcaster_id, @@ -146,7 +146,7 @@ fn heartbeat(conn: HandlerResult, log: RequestLogger) -> status::Custo Ok(_) => Status::Ok, Err(e) => { let status = Status::ServiceUnavailable; - slog_error!(log, "Database heartbeat failed: {}", e; "code" => status.code); + error!(log, "Database heartbeat failed: {}", e; "code" => status.code); status } }; diff --git a/src/main.rs b/src/main.rs index fb512b0..5e6d1b3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,12 +16,7 @@ extern crate rocket; extern crate rocket_contrib; extern crate serde; extern crate serde_json; -// prefer slog_ names to avoid conflicting w/ rocket's error!. rocket -// 0.4 will rename it to catcher -#[macro_use( - slog_b, slog_debug, slog_error, slog_log, slog_kv, slog_info, slog_o, slog_record, - slog_record_static, slog_warn -)] +#[macro_use] extern crate slog; extern crate slog_async; extern crate slog_mozlog_json;