bugfixes
Rust logging client for Bugfixes.
It provides:
- local log output with file and line capture
- global logging macros for application code
- explicit logger instances for dependency injection
- optional remote reporting to
POST /log - optional panic and bug reporting to
POST /bug - local-only logging paths for operational noise
Install
[]
= "0.1.0"
Environment
Remote reporting is configured through:
BUGFIXES_AGENT_KEYBUGFIXES_LOG_LEVELBUGFIXES_LOCAL_ONLYBUGFIXES_SERVER
If the API key is missing, logs still print locally and remote reporting is skipped.
Examples
Runnable examples live in examples/:
cargo run --example app_initcargo run --example explicit_loggercargo run --example local_only
Recommended app setup
For most binaries, initialize the global logger once at startup and then use the macros everywhere else:
That is usually all you need. You do not need a custom init function to fall back to local-only mode when credentials are absent.
Explicit logger instances
Use explicit logger instances in library code, services built around dependency injection, or anywhere you want logging to be passed in explicitly:
use BugfixesLogger;
Local-only logging
Use local-only logging when a message should never be sent remotely:
use ;
API shape
The crate supports both:
- explicit logger instances for libraries and injected dependencies
- global macros for application code
local_logger()for direct local-only loggingbugfixes::local::{...}macros for namespaced local-only logging
Typical macro usage looks like this:
debug!;
info!;
warn!;
error!?;
Panic capture is available either explicitly:
let logger = from_env?;
let _ = logger.report_panic_payload;
or through a global hook:
init_global_from_env?;
install_global_panic_hook;