update to sys 0.6 and proxmox-log crate

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2024-07-17 12:44:46 +02:00
parent b3b8b375c2
commit 885830935c
5 changed files with 29 additions and 18 deletions

View File

@ -1,14 +1,14 @@
use env_logger::{Builder, Env};
use std::io::Write;
use anyhow::Error;
/// Initialize logging. Should only be called once
pub fn init(env_var_name: &str, default_log_level: &str) {
if let Err(e) = Builder::from_env(Env::new().filter_or(env_var_name, default_log_level))
.format(|buf, record| writeln!(buf, "{}: {}", record.level(), record.args()))
.write_style(env_logger::WriteStyle::Never)
.format_timestamp(None)
.try_init()
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, "<pve>")
})
{
eprintln!("could not set up env_logger: {e}");
eprintln!("could not set up env_logger: {e:?}");
}
}

View File

@ -15,7 +15,6 @@ crate-type = ["cdylib"]
[dependencies]
anyhow = "1.0"
env_logger = "0.10"
hex = "0.4"
http = "0.2.7"
libc = "0.2"
@ -25,6 +24,7 @@ openssl = "0.10.40"
serde = "1.0"
serde_bytes = "0.11"
serde_json = "1.0"
tracing = "0.1.37"
url = "2"
perlmod = { version = "0.13.4", features = ["exporter"] }
@ -35,8 +35,9 @@ proxmox-apt-api-types = "1.0"
proxmox-config-digest = "0.1"
proxmox-http = { version = "0.9", features = ["client-sync", "client-trait"] }
proxmox-http-error = "0.1.0"
proxmox-log = "0.1"
proxmox-notify = "0.4"
proxmox-subscription = "0.4"
proxmox-sys = "0.5"
proxmox-sys = "0.6"
proxmox-tfa = { version = "5", features = ["api"] }
proxmox-time = "2"

View File

@ -6,10 +6,10 @@ Build-Depends: cargo:native <!nocheck>,
librust-openssl-probe-dev (= 0.1.5-1~bpo12+pve1),
dh-cargo (>= 25),
librust-anyhow-1+default-dev,
librust-env-logger-0.10+default-dev,
librust-hex-0.4+default-dev,
librust-http-0.2+default-dev (>= 0.2.7-~~),
librust-libc-0.2+default-dev,
librust-log-0.4+default-dev (>= 0.4.17-~~),
librust-nix-0.26+default-dev,
librust-openssl-0.10+default-dev (>= 0.10.40-~~),
librust-perlmod-0.13+default-dev (>= 0.13.4-~~),
@ -17,20 +17,25 @@ Build-Depends: cargo:native <!nocheck>,
librust-proxmox-acme-0.5+api-types-dev,
librust-proxmox-acme-0.5+client-dev,
librust-proxmox-acme-0.5+default-dev,
librust-proxmox-apt-0.10+default-dev,
librust-proxmox-apt-0.11+cache-dev,
librust-proxmox-apt-0.11+default-dev,
librust-proxmox-apt-api-types-1+default-dev,
librust-proxmox-config-digest-0.1+default-dev,
librust-proxmox-http-0.9+client-sync-dev,
librust-proxmox-http-0.9+client-trait-dev,
librust-proxmox-http-0.9+default-dev,
librust-proxmox-http-error-0.1+default-dev,
librust-proxmox-log-0.1+default-dev,
librust-proxmox-notify-0.4+default-dev,
librust-proxmox-subscription-0.4+default-dev,
librust-proxmox-sys-0.5+default-dev,
librust-proxmox-sys-0.6+default-dev,
librust-proxmox-tfa-5+api-dev,
librust-proxmox-tfa-5+default-dev,
librust-proxmox-time-2+default-dev,
librust-serde-1+default-dev,
librust-serde-bytes-0.11+default-dev,
librust-serde-json-1+default-dev,
librust-tracing-0.1+default-dev (>= 0.1.37-~~),
librust-url-2+default-dev,
libstd-rust-dev <!nocheck>,
perlmod-bin (>= 0.2.0-3),

View File

@ -17,7 +17,6 @@ crate-type = ["cdylib"]
anyhow = "1.0"
base32 = "0.4"
base64 = "0.13"
env_logger = "0.10"
hex = "0.4"
http = "0.2.7"
libc = "0.2"
@ -27,6 +26,7 @@ openssl = "0.10.40"
serde = "1.0"
serde_bytes = "0.11"
serde_json = "1.0"
tracing = "0.1.37"
url = "2"
perlmod = { version = "0.13", features = ["exporter"] }
@ -36,10 +36,11 @@ proxmox-apt-api-types = "1.0"
proxmox-config-digest = "0.1"
proxmox-http = { version = "0.9", features = ["client-sync", "client-trait"] }
proxmox-http-error = "0.1.0"
proxmox-log = "0.1"
proxmox-notify = { version = "0.4", features = ["pve-context"] }
proxmox-openid = "0.10"
proxmox-resource-scheduling = "0.3.0"
proxmox-subscription = "0.4"
proxmox-sys = "0.5"
proxmox-sys = "0.6"
proxmox-tfa = { version = "5", features = ["api"] }
proxmox-time = "2"

View File

@ -7,7 +7,6 @@ Build-Depends: cargo:native <!nocheck>,
librust-anyhow-1+default-dev,
librust-base32-0.4+default-dev,
librust-base64-0.13+default-dev,
librust-env-logger-0.10+default-dev,
librust-hex-0.4+default-dev,
librust-http-0.2+default-dev (>= 0.2.7-~~),
librust-libc-0.2+default-dev,
@ -16,23 +15,28 @@ Build-Depends: cargo:native <!nocheck>,
librust-openssl-0.10+default-dev (>= 0.10.40-~~),
librust-perlmod-0.13+default-dev,
librust-perlmod-0.13+exporter-dev,
librust-proxmox-apt-0.10+default-dev (>= 0.10.6-~~),
librust-proxmox-apt-0.11+cache-dev,
librust-proxmox-apt-0.11+default-dev,
librust-proxmox-apt-api-types-1+default-dev,
librust-proxmox-config-digest-0.1+default-dev,
librust-proxmox-http-0.9+client-sync-dev,
librust-proxmox-http-0.9+client-trait-dev,
librust-proxmox-http-0.9+default-dev,
librust-proxmox-http-error-0.1+default-dev,
librust-proxmox-log-0.1+default-dev,
librust-proxmox-notify-0.4+default-dev,
librust-proxmox-notify-0.4+pve-context-dev,
librust-proxmox-openid-0.10+default-dev,
librust-proxmox-resource-scheduling-0.3+default-dev,
librust-proxmox-subscription-0.4+default-dev,
librust-proxmox-sys-0.5+default-dev,
librust-proxmox-sys-0.6+default-dev,
librust-proxmox-tfa-5+api-dev,
librust-proxmox-tfa-5+default-dev,
librust-proxmox-time-2+default-dev,
librust-serde-1+default-dev,
librust-serde-bytes-0.11+default-dev,
librust-serde-json-1+default-dev,
librust-tracing-0.1+default-dev (>= 0.1.37-~~),
librust-url-2+default-dev,
libstd-rust-dev <!nocheck>,
perlmod-bin (>= 0.2.0-3),