Use log crate for logging instead of println
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
use std::str::FromStr;
|
||||
|
||||
use log::error;
|
||||
|
||||
use actix_web::error::ErrorUnauthorized;
|
||||
use actix_web::{dev, http::header, Error, FromRequest, HttpRequest};
|
||||
use futures::future::{err, ok, Ready};
|
||||
@@ -21,7 +23,6 @@ pub fn secret_key() -> String {
|
||||
if cfg!(test) {
|
||||
String::from("test_key")
|
||||
} else {
|
||||
println!("USING REAL KEY");
|
||||
dotenv::var("SECRET_KEY").expect("SECRET_KEY env not set!")
|
||||
}
|
||||
}
|
||||
@@ -39,7 +40,7 @@ impl FromStr for Claims {
|
||||
) {
|
||||
Ok(data) => Ok(data.claims),
|
||||
Err(other) => {
|
||||
println!("DecodeError: {}", other);
|
||||
error!("DecodeError: {}", other);
|
||||
Err(other)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user