feat: switch to systemd-journal-logger, add debug logging (v0.4.0)

Replace env_logger file-based logging with systemd-journal-logger for
consistency with moonlock and native journalctl integration. Add debug-level
logging at all decision points: config loading, user/session detection,
avatar resolution, locale detection, IPC messages, login flow, and
persistence. No credentials are ever logged.
This commit is contained in:
2026-03-28 01:23:18 +01:00
parent b91e8d47d1
commit 96c94f030a
11 changed files with 137 additions and 230 deletions
+4
View File
@@ -23,6 +23,7 @@ impl std::error::Error for PowerError {}
/// Run a command and return a PowerError on failure.
fn run_command(action: &'static str, program: &str, args: &[&str]) -> Result<(), PowerError> {
log::debug!("Power action: {action} ({program} {args:?})");
let child = Command::new(program)
.args(args)
.spawn()
@@ -38,6 +39,9 @@ fn run_command(action: &'static str, program: &str, args: &[&str]) -> Result<(),
message: e.to_string(),
})?;
if output.status.success() {
log::debug!("Power action {action} completed successfully");
}
if !output.status.success() {
let stderr = String::from_utf8_lossy(&output.stderr);
return Err(PowerError::CommandFailed {