mirror of
https://git.proxmox.com/git/proxmox-perl-rs
synced 2025-05-24 03:05:57 +00:00

This commit sets up logging by hooking into module loading/bootstraping process to call a new `init` function exported by the `Proxmox::Lib::{PVE,PMG}` module, which initializes `env_logger` with its default settings. This allows us to use `log::*` macros from Rust code. Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
7 lines
175 B
Rust
7 lines
175 B
Rust
/// Initialize logging. Should only be called once
|
|
pub fn init() {
|
|
if let Err(e) = env_logger::try_init() {
|
|
eprintln!("could not set up env_logger: {e}");
|
|
}
|
|
}
|