Add some logging so that with the env variable RUST_LOG=debug or similar, there is timestamped output to stderr

This commit is contained in:
Barry Pederson
2026-02-03 15:57:11 -08:00
parent 83d437c9ce
commit 1de0fa16db
6 changed files with 151 additions and 5 deletions
+4
View File
@@ -8,6 +8,7 @@ use argon2::{
use std::fs::File;
use std::io::{BufRead, BufReader};
use std::path::PathBuf;
use log::info;
#[derive(Clone)]
pub struct PasswordDirectory {
@@ -49,6 +50,7 @@ impl PasswordDirectory {
///
fn check_hashed_password(&self, lines: &Vec<String>, password: &str) -> bool {
let (key, split_password) = password.strip_prefix('[').unwrap().split_once(']').unwrap();
info!(" looking for password-key: [{}]", key);
let mut result = false;
@@ -72,6 +74,8 @@ impl PasswordDirectory {
}
fn check_plain_password(&self, lines: &Vec<String>, password: &str) -> bool {
info!(" looking for plain password");
let mut result = false;
for line in lines {