Implemented proper logging, with support for file logging, timestamp and syslog (this last one is untested)

This commit is contained in:
Daniel García
2018-12-06 20:35:25 +01:00
parent 259a2f2982
commit 2fde4e6933
13 changed files with 146 additions and 29 deletions

View File

@@ -4,7 +4,7 @@
#[macro_export]
macro_rules! err {
($err:expr, $msg:expr) => {{
println!("ERROR: {}", $msg);
error!("{}", $msg);
err_json!(json!({
"error": $err,
"error_description": $err,
@@ -30,7 +30,7 @@ macro_rules! err_json {
#[macro_export]
macro_rules! err_handler {
($expr:expr) => {{
println!("ERROR: {}", $expr);
error!("{}", $expr);
return $crate::rocket::Outcome::Failure(($crate::rocket::http::Status::Unauthorized, $expr));
}}
}