Struct std_logger_parser::Parser[][src]

pub struct Parser<R> { /* fields omitted */ }

A struct to parse logfmt formatted logs.

See the example below for usage.

Notes

The parser assumses the log lines are mostly correct. This means it will loosely check values but isn’t too strict about it.

If this parser returns an error it will skip the problematic line and continue with the next one. Note however that if a problem exists in multi-line log message the records returned after might be invalid.

Examples

The API is simple, just call parse in a for loop.

use std_logger_parser::parse;

let logs = /* Open some log file, anything that implements `io::Read`. */

for record in parse(logs) {
    let record = record?;

    println!("parsed a record: {:?}", record);
}

Trait Implementations

impl<R: Debug> Debug for Parser<R>[src]

impl<R: Read> Iterator for Parser<R>[src]

type Item = Result<Record, ParseError>

The type of the elements being iterated over.

Auto Trait Implementations

impl<R> RefUnwindSafe for Parser<R> where
    R: RefUnwindSafe

impl<R> Send for Parser<R> where
    R: Send

impl<R> Sync for Parser<R> where
    R: Sync

impl<R> Unpin for Parser<R> where
    R: Unpin

impl<R> UnwindSafe for Parser<R> where
    R: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.