Debugging, Logging
Help you figure out what is going on with your code such as logging, tracing, or assertions.
Tracing
Recipe | Crates | Categories |
---|---|---|
Initialize the logger | ||
Enable basic tracing | ||
Combine layers | ||
Configure a custom event formatter | ||
Events | ||
Spans | ||
Add tracing spans to functions | ||
See also |
[tracing.incl: fix (P1)](https://github.com/john-cd/rust_howto/issues/321)
Logging
Recipe | Crates | Categories |
---|---|---|
Log a debug message to the console | ||
Log an error message to the console | ||
Log to stdout instead of stderr | ||
Log messages with a custom logger | ||
Log to the Unix syslog |
[log.incl: fix (P1)](https://github.com/john-cd/rust_howto/issues/320)
Log Configuration
Recipe | Crates | Categories |
---|---|---|
Enable log levels per module | ||
Use a custom environment variable to set up logging | ||
Include a timestamp in log messages | ||
Log messages to a custom location |
[config_log.incl: fix (P1)](https://github.com/john-cd/rust_howto/issues/318)
Alternatives
Recipe | Crates | Categories |
---|---|---|
log | ||
slog | ||
log4rs | ||
env_logger | ||
OpenTelemetry | OpenTelemetry Rust documentation⮳ | |
OpenObserve | OpenObserve⮳ |
[alternatives.incl: open telemetry, open observe (P1)](https://github.com/john-cd/rust_howto/issues/316)
Diagnostic functions
Recipe | Crates | Categories |
---|---|---|
Get the type name of the pointed-to value |
[index: reorganize; dedupe alternatives / log / config_log (P1)](https://github.com/john-cd/rust_howto/issues/319)