[pve-devel] [PATCH proxmox-mail-forward 2/2] switch to proxmox-log

Gabriel Goller g.goller at proxmox.com
Fri Dec 6 11:40:02 CET 2024


> fn main() {
>-    if let Err(err) = syslog::init(
>-        syslog::Facility::LOG_DAEMON,
>-        log::LevelFilter::Info,
>-        Some("proxmox-mail-forward"),
>-    ) {
>+    if let Err(err) = proxmox_log::init_logger("PROXMOX_LOG", LevelFilter::INFO) {
>         eprintln!("unable to initialize syslog: {err}");
>     }
>

Haven't looked at this crate yet, so I don't know where it's all used,
but IMO the new `init_perlmod_logger` would be better? Because the
`init_logger` function will always print to journald and check if a
pbs task exists (which will never happen here afaiu).
We can also add another simpler subscriber which will only log to
journald (I can also do that, just let me know).

Btw now I release how stupid these function names are, I should rename
them in the future eliding the `perlmod`, `cli` names. Something like
`init_journald_and_tasks` and `init_stderr_and_journald`.




More information about the pve-devel mailing list