kamu‑logging
kamu‑logging is a small helper crate to configure structured logging for
services built by PT IMMER. It wraps the tracing
ecosystem and selects an appropriate backend depending on your target
platform.
Supported targets
-
Systemd (default) – When the
systemdfeature is enabled, the crate initialises atracingsubscriber that forwards logs from thelogcrate, parses theRUST_LOGenvironment variable, and emits either coloured console output or forwards events to journald when not attached to a TTY. -
WASM (
wasm32feature) – On WebAssembly targets the crate installsconsole_error_panic_hookto improve panic messages and configures thewasm‑tracingsubscriber. -
Actix Web (
logging‑actix‑webfeature) – Exposes aget_actix_web_logger()function returning an Actix Web middleware logger.
Usage
Add the crate to your Cargo.toml and call kamu_logging::init() early
in main. At least one of the mutually exclusive systemd or
wasm32 features must be enabled. The systemd feature is enabled by
default.
[]
= "0.1.2"
When building for wasm32 targets, enable the wasm32 feature and
disable the default features:
[]
= { = "0.1.2", = false, = ["wasm32"] }
License
This project is licensed under the MIT License. See the LICENSE file for details.