improv: replace eprintln with logger (#18) + fix mod documentation

This commit is contained in:
2022-11-07 10:47:45 +00:00
parent 45c9112af2
commit 17a098ef89
7 changed files with 22 additions and 21 deletions
+9 -6
View File
@@ -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;
}