logtra is a logging library for Rust.
- Sinks
- Register a sink
- Unregister a sink
- Log
- Formatting
- timestamp
- current ThreadId
- module
- severity
- name of sink
- file
- line
- color
- message
- Macro
- Different Log Intensities
- Expressions/Evaluations
- Asserts
- Evaluating asserts (assert)
- Conditional logs (cassert)
- Panicking asserts (passert)
- Formatting
logtra is almost entirely macro based.
fn main() {
sink!(
ConsoleSink::new(
SinkDeclaration {
name: "console".to_string(),
severity: LogSeverity::Trace,
module: "".to_string(),
template: "[%t][%c][%[%i%]][%s][%f:%l]: %m\n".to_string(),
}
)
)
trace!("Hello World: Trace!");
debug!("Hello World: Debug!");
info!("Hello World: Info!");
warn!("Hello World: Warn!");
error!("Hello World: Error!");
fatal!("Hello World: Fatal!");
log!(Info, &obj);
}