bugfixes
Rust logging client for Bugfixes, extracted from the behavior of the Go logs package in this repository.
Current scope:
- local log output
- caller file/line capture
- level filtering
- optional remote reporting to
POST /log - optional panic/bug reporting to
POST /bug - error/fatal helpers
Not ported yet:
- Go HTTP middleware utilities
- framework-specific integrations
Install
[]
= "0.1.0"
Example
use ;
Use BugfixesLogger::from_env() to enable remote reporting through:
BUGFIXES_AGENT_KEYBUGFIXES_AGENT_SECRETBUGFIXES_LOG_LEVELBUGFIXES_LOCAL_ONLYBUGFIXES_SERVER
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;
API shape
The crate supports both:
- explicit logger instances, which are best for libraries and dependency injection
- global macros, which are the most idiomatic application-facing Rust API
local_logger(), which is the direct local-only equivalent of Go'slogs.Local()
The macros preserve the Go package's functional intent while fitting normal Rust call patterns:
debug!;
info!;
warn!;
error!?;