log: use new logging builder, print to stderr and journald

Use the new builder. Print the logs to stderr and journald always.
Remove the log dependency.

Suggested-by: Lukas Wagner <l.wagner@proxmox.com>
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
This commit is contained in:
Gabriel Goller 2025-02-18 17:16:41 +01:00 committed by Wolfgang Bumiller
parent 8b3eda5893
commit d08df46683
4 changed files with 7 additions and 4 deletions

View File

@ -5,7 +5,12 @@ pub fn init(env_var_name: &str, default_log_level: &str) {
if let Err(e) = default_log_level
.parse()
.map_err(Error::from)
.and_then(|default_log_level| proxmox_log::init_logger(env_var_name, default_log_level))
.and_then(|default_log_level| {
proxmox_log::Logger::from_env(env_var_name, default_log_level)
.stderr_pve()
.journald()
.init()
})
{
eprintln!("could not set up env_logger: {e:?}");
}

View File

@ -18,7 +18,6 @@ anyhow = "1.0"
hex = "0.4"
http = "0.2.7"
libc = "0.2"
log = "0.4.17"
nix = "0.26"
openssl = "0.10.40"
serde = "1.0"

View File

@ -29,7 +29,7 @@ mod export {
}
pub fn send_updates_available(_updates: &[&APTUpdateInfo]) -> Result<(), Error> {
log::warn!("update notifications are not implemented for PMG yet");
tracing::warn!("update notifications are not implemented for PMG yet");
Ok(())
}

View File

@ -20,7 +20,6 @@ base64 = "0.13"
hex = "0.4"
http = "0.2.7"
libc = "0.2"
log = "0.4.17"
nix = "0.26"
openssl = "0.10.40"
serde = "1.0"