Prologue Logger
A Rust library to produce Rust-like logs for source code or settings files.
It offers many features, like:
- easy-to-use building patterns to customize the log entries;
- annotating source code lines with the Rust-like
^^^underline; - counting warnings and errors for multiple targets;
- colored output to
stderr(requires theconsolefeature); - integration with the
logAPI (requires thelogfeature); - integration with the
indicatifcrate (requires theindicatiffeature); - color support with the
consolecrate (requires theconsolefeature).
Usage
The simplest usage consists of creating a target to log to and then log entries to it.
use ;
Examples
examples/simple.rs
Features: console

examples/log.rs
Features: console, log

examples/file.rs
Features: log
Contents of file.log:
warning: starting `file.rs` -- the following is NOT generated by `cargo`
Running example `file.rs`
warning: this is a warning line
--> examples/file.rs:8:36
|
8 | let entry = Entry::new_warning("this is a warning line")
| ----- ------------------ ^^^^^^^^^^^^^^^^^^^^^^^^ this is the text
| | |
| | this is the invoking function
| |
| this is the variable
9 | .bright()
10 | .source(source)
11 | .forward_to_stderr();
| ^^^^^^^^^^^^^^^^^ this function does not increase the warning count
|
= note: this is not the actual source code
= help: to see the actual source code for this example,
see `examples/file.rs`
= note: this output is generated by `prologue-logger` and NOT by `cargo`
examples/indicatif.rs
Features: console, indicatif, log
