summaryrefslogtreecommitdiffstats
path: root/src/password.rs
diff options
context:
space:
mode:
authorqkzk <qu3nt1n@gmail.com>2023-09-26 10:23:43 +0200
committerqkzk <qu3nt1n@gmail.com>2023-09-26 10:23:43 +0200
commit35c9e0877578d36c5ba8b6da7fa34efe85b40a67 (patch)
treecdaa54b38692d87b1eae565d9e8163def6a45abf /src/password.rs
parent7f36af489ab82324b5a11b89e8a5ace3b3409bb3 (diff)
use memory to read & write last action log line
Diffstat (limited to 'src/password.rs')
-rw-r--r--src/password.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/password.rs b/src/password.rs
index 9e34e11..c1b16d1 100644
--- a/src/password.rs
+++ b/src/password.rs
@@ -4,6 +4,7 @@ use std::process::{Command, Stdio};
use anyhow::{Context, Result};
use log::info;
+use crate::log::write_log_line;
use crate::utils::current_username;
/// Different kind of password
@@ -97,10 +98,8 @@ where
P: AsRef<std::path::Path> + std::fmt::Debug,
{
info!("sudo_with_password {args:?} CWD {path:?}");
- info!(
- target: "special",
- "running sudo command with password. args: {args:?}, CWD: {path:?}"
- );
+ let log_line = format!("running sudo command with password. args: {args:?}, CWD: {path:?}");
+ write_log_line(log_line);
let mut child = Command::new("sudo")
.arg("-S")
.args(args)
@@ -131,7 +130,8 @@ where
S: AsRef<std::ffi::OsStr> + std::fmt::Debug,
{
info!("running sudo {:?}", args);
- info!(target: "special", "running sudo command. {args:?}");
+ let log_line = format!("running sudo command. {args:?}");
+ write_log_line(log_line);
let child = Command::new("sudo")
.args(args)
.stdin(Stdio::null())