Skip to content

Commit

Permalink
refactor: prefer regular slog macro names
Browse files Browse the repository at this point in the history
  • Loading branch information
pjenvey committed Dec 29, 2018
1 parent 1aa4aa1 commit 1e6b61d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!({
Expand Down
4 changes: 2 additions & 2 deletions src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -146,7 +146,7 @@ fn heartbeat(conn: HandlerResult<db::Conn>, 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
}
};
Expand Down
7 changes: 1 addition & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ extern crate rocket;
extern crate rocket_contrib;
extern crate serde;
extern crate serde_json;
// prefer slog_<level> 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;
Expand Down

0 comments on commit 1e6b61d

Please sign in to comment.