prettyprint 0.8.1

Print beautifully formatted files and strings to your terminal
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Run
//! ```
//! cargo run --example stderr 2> error.log
//! ```
//! then the `error.log` file should contain `ERROR: unexpected` with some gibberish

use prettyprint::{PagingMode, PrettyPrintError, PrettyPrinter};

fn main() -> Result<(), PrettyPrintError> {
    let epprint = PrettyPrinter::default()
        .paging_mode(PagingMode::Error)
        // Comment ☝️ to make `error.log` empty
        .build()
        .unwrap();

    epprint.string("ERROR: unexpected")
}