improv: replace eprintln with logger (#18) + fix mod documentation
This commit is contained in:
@@ -34,7 +34,10 @@ impl TryFrom<Ini> for Config {
|
||||
match u64::from_str(&exp_time) {
|
||||
Ok(v) => v,
|
||||
Err(e) => {
|
||||
eprintln!("unable to convert JWT expiration time into u64 err={}", e);
|
||||
log::error!(
|
||||
"unable to convert JWT expiration time into u64 details={}",
|
||||
e
|
||||
);
|
||||
0
|
||||
}
|
||||
}
|
||||
@@ -59,27 +62,27 @@ impl Config {
|
||||
/// validates config ini file
|
||||
fn validate(&self) -> bool {
|
||||
if self.jwt_exp_time <= 0 {
|
||||
eprintln!("invalid config parameter: JWT expiration time is negative or equals to 0");
|
||||
log::error!("invalid config parameter: JWT expiration time is negative or equals to 0");
|
||||
return false;
|
||||
}
|
||||
|
||||
if self.jwt_issuer == "" {
|
||||
eprintln!("invalid config parameter: JWT issuer is empty");
|
||||
log::error!("invalid config parameter: JWT issuer is empty");
|
||||
return false;
|
||||
}
|
||||
|
||||
if self.jwt_pub_key == "" {
|
||||
eprintln!("invalid config parameter: JWT public key file path is empty");
|
||||
log::error!("invalid config parameter: JWT public key file path is empty");
|
||||
return false;
|
||||
}
|
||||
|
||||
if self.jwt_priv_key == "" {
|
||||
eprintln!("invalid config parameter: JWT private key file path is empty");
|
||||
log::error!("invalid config parameter: JWT private key file path is empty");
|
||||
return false;
|
||||
}
|
||||
|
||||
if self.filestore_path == "" {
|
||||
eprintln!("invalid config parameter: filestore path is empty");
|
||||
log::error!("invalid config parameter: filestore path is empty");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user