diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2020-12-29 19:21:30 +0100 |
---|---|---|
committer | Colin Reeder <colin@vpzom.click> | 2020-12-29 11:32:11 -0700 |
commit | 489ebc60b6fc6ad3fe6ee2baec17cce08051b2e8 (patch) | |
tree | 19709fb3050147d841c3ba75661927d27f22a923 | |
parent | 68fb618980573ee0bd06457e49b792394f191ef3 (diff) |
Replace eprintln!() calls with log::error!()
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r-- | src/main.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index 76b2405..e757cc4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -122,7 +122,7 @@ impl Translator { let pattern = match pattern { Some(pattern) => pattern, None => { - eprintln!("Missing message in translation: {}", key); + log::error!("Missing message in translation: {}", key); return Cow::Borrowed(key); } }; @@ -130,7 +130,7 @@ impl Translator { let mut errors = Vec::with_capacity(0); let out = self.bundle.format_pattern(pattern, args, &mut errors); if !errors.is_empty() { - eprintln!("Errors in translation: {:?}", errors); + log::error!("Errors in translation: {:?}", errors); } out @@ -167,7 +167,7 @@ pub fn get_lang_for_headers(headers: &hyper::header::HeaderMap) -> Translator { match err { fluent::FluentError::Overriding { .. } => {} _ => { - eprintln!("Failed to add language resource: {:?}", err); + log::error!("Failed to add language resource: {:?}", err); break; } } @@ -216,7 +216,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { Err(Error::UserError(res)) => res, Err(Error::RoutingError(err)) => err.to_simple_response(), Err(err) => { - eprintln!("Error: {:?}", err); + log::error!("Error: {:?}", err); simple_response( hyper::StatusCode::INTERNAL_SERVER_ERROR, |