acap-logging

Crates.ioacap-logging
lib.rsacap-logging
version0.1.0
sourcesrc
created_at2024-06-19 21:43:12.838445
updated_at2024-10-17 16:59:46.106424
descriptionLogging utilities for ACAP applications
homepagehttps://github.com/AxisCommunications/acap-rs
repositoryhttps://github.com/AxisCommunications/acap-rs
max_upload_size
id1277375
size3,501
AP Ljungquist (apljungquist)

documentation

README

Logging utilities for ACAP applications

Example

The logger is initialized as early as possible:

use log::{error, warn};

fn main() {
    # std::env::set_var("RUST_LOG_STYLE", "always");
    error!("This will never be shown");
    acap_logging::init_logger();
    error!("This will usually be shown");
}

Pitfalls

  • Messages logged at the trace level will not be shown in the system logs on target.
  • Messages logged at the warn level or less severe will not be shown in terminals by default.
  • When the tracing crate is used in place of the log crate, its log feature must be enabled.
Commit count: 94

cargo fmt