5
0
mirror of git://git.proxmox.com/git/proxmox-backup.git synced 2025-01-20 14:03:53 +03:00

file-restore: set loglevel considering PBS_QEMU_DEBUG

during some tests recently I wondered why a debug log-message was not
printed, despite running with PBS_QEMU_DEBUG.

This patch sets the loglevel for the cli logger to debug if the
variable is present and not-empty (see qemu_helper.rs for the other
usage).

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
This commit is contained in:
Stoiko Ivanov 2023-06-15 12:42:57 +02:00 committed by Thomas Lamprecht
parent ce3f15aeac
commit 39531dfc80

View File

@ -585,7 +585,12 @@ where
}
fn main() {
init_cli_logger("PBS_LOG", "info");
let loglevel = match std::env::var("PBS_QEMU_DEBUG") {
Ok(val) if !val.is_empty() => "debug",
_ => "info"
};
init_cli_logger("PBS_LOG", loglevel);
let list_cmd_def = CliCommand::new(&API_METHOD_LIST)
.arg_param(&["snapshot", "path"])